[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - monster_spawn function?

monster_spawn function?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Re: monster_spawn function?

Postby hondobondo » Wed Mar 21, 2012 9:56 pm

Last edited by hondobondo on Wed Mar 21, 2012 10:00 pm, edited 1 time in total.

hondobondo
 
Posts: 207
Joined: Tue Sep 26, 2006 2:48 am

Re: monster_spawn function?

Postby hondobondo » Wed Mar 21, 2012 9:58 pm

i was also able at one point to spawn an entire set of monsters in one spot, for some reason i never used it

you have to create a loop, then set origin to origin_x + n

while (n < 256)
{
monster spawn code
setorigin(monster,origin_x + n);
n = n + 32;
}

just adapt the dmsp.qc stuff

hondobondo
 
Posts: 207
Joined: Tue Sep 26, 2006 2:48 am

Re: monster_spawn function?

Postby ajay » Fri Nov 02, 2012 10:01 pm

Ok, I'm trying to use the excellent examples here for my mod. Breakdown on what I want to happen:
- Monsters need to appear at a pre-arranged point in the map ("The Gate")
- What/how many monsters will be dependent on what "goal" the player has reached, so they'll need to be a "if (goal_mission == 1)" type of thing going on, into which I'll set the type/number etc
- They'll be separate points for each monster that arrives (info_monster_arrival_1, info_monster_arrival_2 etc) but which will be re-used for each goal_mission ("wave")
- They'll be a total number of "info_monster_arrival_" 's, though not all will be used for each goal_mission - I'll not need to check they're clear though

My questions are these:
- obviously is this all do-able?
- can you create "info_monster_arrival" points (instead of info_player_start"); is there anything I need to do other than create them in quake.fgd and then use them in the spawn code instead of info_player_start?
- could someone explain the precaching a bit more - do I just need to precache the mdl or is there anything else, and where? In the new .qc or world.qc, defs etc?

Thanks as always
ajay
User avatar
ajay
 
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Re: monster_spawn function?

Postby goldenboy » Sat Nov 03, 2012 12:49 am

User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Re: monster_spawn function?

Postby ajay » Sat Nov 03, 2012 3:29 pm

Thanks gb, great answer, very helpful
ajay
User avatar
ajay
 
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Re: monster_spawn function?

Postby Seven » Mon Nov 05, 2012 11:50 am

Hello ajay,

Regarding precaching:
The worldspawn () function (in world.qc) has been commented nicely (even in original 1.06 source code). So you can quickly see how and what to precache there.

Regarding monster "waves":
Will you use your own maps, or will/shall your mod be playable with existing maps ?
The positioning of "The Gate" is the most sensible thing in case 2.
Which should not be a problem in case 1, because you know the exact x/y/z coordinate.

Once you set your "Gate" origin/position, you maybe want to take a look into the source of the "IQ reprised" mod:
http://quakeone.com/forums/quake-mod-re ... rised.html
ezzetabi coded a "monster-wave" into Entar´s IQ mod.
ezzetabi described that "monster-wave" function in the thread itself and I think this code could be very useful for you.
He uses the position of the killed enemies as "The Gate" for new enemies.
That is the only difference to your idea I guess, which should make it even 'easier' to implement it (with a fixed/static "Gate").

Good luck,
Seven.
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: monster_spawn function?

Postby Seven » Wed Nov 28, 2012 5:49 pm

Dear all,

I didnt want to start a new thread for that small question I have:
It always wondered me what exactly happens (engine and file sided) when a file is precached.
Is that model/sound written into a big temporary file (like the windows pagefile.sys) or into ram ?

Next question is, will one file be precached everytime a precache codeline is read by the engine ?
Example the monsters spawn functions:
They precache the monsters individual models + sounds.
But when a map has 20 soldiers, will these files be precached 20 times ?
Or does the engine notice that it already precached that model/sound and skips it next time.

Due to the fact that I use the "dp-precache-anywhere-anytime" extension, I wonder if loading time will be affected
when a single file is precached 10 times, or does the engine skip it after it was precached 1st time.

Thank you for your answer.
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: monster_spawn function?

Postby mankrip » Wed Nov 28, 2012 6:14 pm

They use the RAM, not a temporary file.

The precache functions creates a list of files to be cached, and repetitions are skipped. So, when you have 20 soldiers, only one instance of the soldier.mdl will be cached.

Also, the actual data that is currently not in use can be unloaded from memory (for example, shamblers that are hidden very far away, if no other shambler is currently visible), and the engine will reload their files from disk (and back into the same positions in the lists) when needed.

If I understand it correctly, all that the DP extension does is to allow more items to be added to those lists in the middle of the game. This may have some impact on savegames that uses the .modelindex of models that were loaded after worldspawn, but nothing else.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
/ /
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Re: monster_spawn function?

Postby Spike » Wed Nov 28, 2012 11:45 pm

precaching does two things:
1: establishes a link from model -> modelindex -> model. this means 1-byte modelindexes can be used over the network instead of entire strings, and the client can use direct lookups to get a pointer to the memory representation of the file.
2: moves loading/disk-based stalls to a loading screen, instead of the game randomly freezing when loading data/textures from the disk.

If you precache any time, there will be a window where the modelindex does not map to anything (if datagrams get through before reliables). this can cause issues if the resulting model pointer/size/etc is cached/dereferenced.
If the entity is animating this is generally fixed on the next update, but I gather dp can fail to update unmodified/unmoving entities.

late caching a bsp model is not recommended. this can result in lightmaps or other loadtime processing not being done (and will give awesome lighting glitches in fte, I assume dp is similar).

for monsters or missiles or whatever it should not be a real issue, so long as you don't mind the stalls.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: monster_spawn function?

Postby Seven » Thu Nov 29, 2012 8:10 am

Thank you mankrip and Spike.

That answeres all my questions.

And yes, even though I use dp´s extension, I precache files whenever possible in worldspawn or main monster spawn functions.
Only in rare conditions, where these files will be used only in certain circumstances I precache them several functions before they are used/called/spawned (to prevent unnesseccary precaching for all monsters, etc.)

Thank you again.
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: monster_spawn function?

Postby Baker » Tue Jul 15, 2014 11:02 am

The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Previous

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest