Very Large Number of Destroyable Objectives


(mystman666) #1

I’m new to the whole mapping thing, but I’d like to make a little map so me and my friends could play it.

So anyway, I now have the beginnings of a large office building, and the objective I had in mind was “A group of 1337 Allied Commandos has an operation behind enemy lines: trash the Gestapo/Wehrmacht/whatever headquarters to interrupt their logistics”

I thought that would be a nice change from the standard ‘dynamite this’ or ‘fetch that’.

The point would be to destroy a certain number of (maybe all?) chairs, desks, bookcases, etc etc etc. Now I have a few questions about this:

  1. Does the engine like large numbers of destroyable objectives? I already have quite a few (windows), and my fps is down to 120 or so. (its 200+ in a simple box map, and about 30-40 on railgun). I fear that my fps will totally die if I place a hundred or more items that can all be destroyed.

  2. Does the net-code like large numbers of destroyable objectives? After all, the game has to keep track of which items have been destroyed, and all that info has to be send to all players.

  3. Is it even possible to make a mission like this without a LOT of scripting. I was hoping that you could make a trigger area, and give all the chairs etc a certain flag. I dont know the script language, but in my ideal world, this would be possible:

if (FlaggedItemsInTriggerArea) < 10
DeclareAlliedVictory

Or something like that :D. So when there are less than 10 flagged items remaining, the allies have won. So… is that possible or do you need to write some giant script?

And an unrelated question:
I just started building my structure (only the walls, floors and staircases are finished), but already the xy, yz and xz views are really crowded so to say. Is there any way to make the finished parts invisible in those views? I ask this because I use xy, xz and yz to line up certain parts of the building with other parts, but the ammount of lines is becoming so giant that I cant see what I’m lining up with what.

Thanks in advance for any awnsers :slight_smile:


(nUllSkillZ) #2

Here some information of socks extended Wolfenstein: Enemy Territory Documentation (it can also be found in the LDR that ships with the gtkradiant):

trigger_objective_info (TOI)
This entity is used to represent other entities (func_constructible, func_explosive, misc_commandmap_marker ) on the command map. The state of the construction objective determines what icons are displayed on the command map.

The trigger_objective_info is a brushwork entity and must contain an origin brush; otherwise it will appear half way between its current map position and “0 0 0” map position on the command map. The brushwork area of the trigger_objective_info entity specifies where the player can build, a ‘pliers’ hint icon and an on screen message.

Each map is limited to a maximum of 18 trigger_objective_info entities. This total usually includes command posts, health / ammo cabinets, onscreen hint areas and all constructible objectives. Some constructible objectives may only exist in certain game types. (The map ‘Fueldump’ hits the TOI limit)

It can be found on the page “Construction System”.
Direct Link: Construction System


(seven_dc) #3
  1. I think the limit for the objectives in one map is like 255. But you can have destroyable windows and props more. but It will be hard to do something like you mentioned.

  2. no clue.

  3. No. you need scriting part of every destroyable objective. I would script this kind of event so that the death part of the objective script would increase some accum and check for winning.
    The script would be big but very simple.

You can always select parts of you map and hit “H” button to hide them (Shift + H) brings them back


SANTERIA DICUSSION


(mystman666) #4

Thanks for the quick replies.

nULL: As I read it, that piece of text you quoted is about representing the objectives on the command map, and giving hints like “you’re near the Old City Wall”. I wasnt planning to do that anyway for every chair/bookcase (would give a very crowded command map) Thanks for the link though :slight_smile:

seven_dc: Thanks for the info :slight_smile: I Think I’ll go that way then if there is no simpler option.


(Lanz) #5

The region menu is your friend, use it. :slight_smile:

That let you select an area of the map and hide everyting else besides that. Another tip is to select the brushes you wish to work with (shift+left click) then press I (invert selection) and then H (hide selection), and when you’re done just press shift+H (unhide all).


(mystman666) #6

A thanks, exactly what I needed :slight_smile:


(chavo_one) #7

My first map for RtCW was set in a modern office building. I wanted to give the player the ability to destroy every window in the map because I thought it would be cool to have glass shattering everywhere. However, after I had created around 150 func_explosive windows, my map stopped loading with some obscure error message. I eventually figured out I had hit some sort of entity limit.

Moral of the story, the engine is not designed to have a completely destructive environment.


(mystman666) #8

hmm…

I’m at 50 func_explosives now (30 windows, 12 windows in a glass roof, and 8 ventilation-shaft-exits). I guess I’ll just make it a ‘nuke the vault and steal the docs in it’ mission then… thanks for all the replies :slight_smile:


(nUllSkillZ) #9

In the book* about modding Q3 I’m reading there’s the following said:

Not sure if this is also true for ET.

*Mod Programming in Quake III Arena at amazon.com


(Chruker) #10

In the q3map source code there is a hard limit of 2048 entities. And I have seen a map (in progress) with about 1600 entities.

I’m planning a map that most likely will hit some of these limits.


(chavo_one) #11

Well, do what you like, but I know for a fact that there is a limit to how many func_explosives you can have, and it is much less than 2048. My guesstimate is that 2048 is the entity account at compile time. For example lights and light juniors are entities that get discarded during the compile. What I’m talking about is a runtime entity limit.

When I got errors, I actually had just over 300 func_explosives. The error looked like:

CL_GetSnapshot: truncated 335 entities to 256
Can’t find models/players//head_.skin

Once I lowered the number of func_explosives to less than 256 the map loaded again.


(mystman666) #12

hm…
what I may do, is just copy the same chair a hundred times, and see if it still works. If that works (which it should, according to all numbers here), I can replace a number of the chairs with tables, a number of the chairs with bookcases, etc etc. That way, I might still be able to make my original plan work.

So the plan for tomorrow would be (beddtime here in europe): test if the engine runs smoothly with 150+ items, and start writing the script (and learn the scriptlanguage somewhere along the way :p)

Well, thanks for the help everyone. :slight_smile:


(Chruker) #13

Did a little testing with an iceflake prefab I have. The iceflake was a func_explosive and I copied it until I have 540 of them. The map compiled but on load in ET it came with a MAX_SUBMODELS error. I had a look at the code for q3map and found a limit of 512 models. I reduced the number of iceflakes to 450. But then I got a cg_RegisterGraphics errror about to many inline models. I then checked the Wolfenstein: Enemy Territory source code and found that the limit of models which can be transfered over the net is 256, and since every client need to know what has been destroyed their status need to be transmitted.

There was also a MAX_SOUNDS of 256


(jah) #14

hint these limits would be cool to keep somewhere handy and organized hint


(G0-Gerbil) #15

You could set all your objects up as script_movers to see if they hit another entity limit.
movers can be destroyable, and of course they can catch the destruction easily too in scripts.
In fact, if they all were seperate script_movers but used the same scriptname, in theory you would only need the one script - and count the 'death’s using gobalaccums (not local, because they’d be seperate for each mover).
The last above scripting bit might be equally valid for func_destructs - but not played with them much recently.


(SCDS_reyalP) #16

Beware, the compiletime and runtime limits are different, because some entities are compiletime only.

Also, quite a few entities are created by the game, so even if your map only had 1023 runtime entities, you would still run into problems. Even if it works OK while testing by yourself, remember that there will be a lot more entities on a 64 player server…


(mystman666) #17

update:

I first tried to make my plan work with func_explosive (with both targetname and scriptname as ‘chairscript’ ). I made 1 chair out of brushes, made it the func_explosive, copied it 5 times, and wrote a simple script that went:


chairscript
{
spawn
      {
       wm_announcer "chair spawned"
      } 

death
     {
      wm_announcer "chair destroyed"
     }
}

I placed it in ETmain/maps.

On levelstart, I could see in the console that the ‘chair spawned’ part worked. However, when I destroyed the chairs, I got no message. I double checked my coding, but it seems func_explosives dont call the ‘death’ part?

Anyway, I then made the chairs script_movers (thanks for the suggestion :drink: ). I forgot to enable the ‘solid’ option however so I shot/walked right through them. After finding out that mistake, I tested again, and yes: the chairs died, and I got the message ‘chair destroyed’ for every chair that I killed.

Next goal: making the game count the number of chairs destroyed. I could do this in C++ without having to think a single second about it, but the quake3 script language was a bit new for me :D. After searching the forum again I found all the commands for ‘globalaccum’, and came up with this script:


chairscript
{
         spawn
	{	
	  wait 200

                       //sets the counter to 0
	  globalaccum 0 set 0
	  wm_announce 	"chair spawned"
	}

         death
	{
	  wm_announce   "Chair destroyed!"
	  
                        //increases the counter by one.
	  globalaccum 0 inc 1
	
	  //translated to C++ 'if 3 < globalaccum then do blablabla'
	  globalaccum 0 abort_if_less_than 4
	  wm_announce   "4 chairs pwnt!"
	}
}

(note: I havent tested it yet with the comments in it, so I dont know if they screw up the scripts operation)

Went into the game, and sure enough, when I destroyed 4 chairs, I got the ‘4 chairs pwnt!’ message :clap:

Things to do: Test if I have the same ammount of succes with 30 chairs, and find the ‘allies win’ command.

edit: the 30 chairs test has been succesfull. Only problem (that I also had with the 4 chairs test), is that they dont spawn any splinters/make any sound when destroyed. I think I screwed up a variable somewhere :disgust:

Anyway, as a related scripting question: is it possible to use wm_announcer and globalaccum in combination. As in, the wm_announcers announces a number based on globalaccum.

What I would want is: wm_announcer “number of things left to kill: (30-globalaccum)”
or something like that. But what would be the correct syntax for that?


(G0-Gerbil) #18

not directly, no - you’d need al ong list of globalaccum <X> trigger_if_equal <Y> <object> <trigger_name>
Probably in game_manager.
Best to do it on intervals, eg when 20 left, then 10 then 5 etc.


(mystman666) #19

Ah ok, will look into that tomorrow then :slight_smile:

(been busy with mapping for 10 hours straight now, time for something different :p)