Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Need a lag-proof spawning method!!!!!!!

Author
Message
Pride
16
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Eastern USA
Posted: 10th May 2009 23:05
During the process of making my secret game, I've encountered an issue:

When I have 5 zombies in a room, always active, the game runs at a steady 33 FPS. When I tell these exact same zombies to spawn, the FPS dive-bombs to 22 FPS.

I ask for a simple, yet lag-proof method of spawning, as I need it for my CoD5-type game.

Using Ply's Mod v1.08 in the FPSC v1.09 editor.


"Tempo non é só unha teoría, senón unha forza"
Try and figure it out
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 11th May 2009 08:51
For each spawnable character/entity, there is another entity created that remains invisible, to spawn the necessary entities when it needs to. These entities run a lot of checks, so it will take some more processing power.


If you're using Ply's Mod, what you can try to do (I haven't tested this theory yet, but it should work):

- Put the enemies out of sight of the player
- Place entities (perhaps small invisible static ones, like a decal) where the zombies will eventually spawn.
- When the zombies should be spawned, activate them and have their scripts move them to the invisible entities.


That sounds pretty easy, but more often than not characters are not easy to work with.


The one and only,


Apple Slicer
16
Years of Service
User Offline
Joined: 14th Nov 2008
Location: Oregon, in the rain...
Posted: 11th May 2009 08:56
Hey Ply, Thats an interesting thing to know (Why it lags)

Things like this helps solve curiosities.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 11th May 2009 09:01
Yes, well, surfing through the source for a year has uncovered many of these little tidbits of information.


The one and only,


Pride
16
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Eastern USA
Posted: 12th May 2009 00:26
Thanks Ply, I'll give that method a shot!


"Tempo non é só unha teoría, senón unha forza"
Try and figure it out
FredP
Retired Moderator
18
Years of Service
User Offline
Joined: 27th Feb 2006
Location: Indiana
Posted: 12th May 2009 02:11
So you're saying using a triggerzone to spawn enemies actually takes more processing power than just letting them wander around from the start of the level?

Failing at every guitar game ever made!
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 13th May 2009 07:08
Althought his method eliminates the "invisible spawner", you will also not be able to spawn more than one entity at that spot


@FredP:

While, in my eyes, the extra processing power from the spawner entity is there, it shouldn't be much more intensive on the CPU than a normal entity, but as Pride has pointed out, in some cases it can be.


The one and only,


Pride
16
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Eastern USA
Posted: 14th May 2009 02:17 Edited at: 14th May 2009 03:45
I have made another method of this spawning, but I have one issue. Now I'm gunna Tarantino this.

I used the destroy script to target a dynamic object that I placed at the zombie's original place (in this case I named it 's1'). The destroy script tells the entity to "disappear" and go to 's1'. When he reaches 's1' he regenerates 100 health and "reappears".

The only issue is that I use the "movetarget" command, which makes the character move at a slow speed.

I request a way to modify the speed of the character, or a different method of transportation to a target.

The script, in case anyone was interested



EDIT: Dammit! This script lags the game!!! Help needed, and maybe a little reward for those who provide help for the final solution


"Tempo non é só unha teoría, senón unha forza"
Try and figure it out
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 14th May 2009 09:56
Does the game lag when you use a normal destroy script? If it does, then it's not the destroy script causing the lag.


The one and only,


Pride
16
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Eastern USA
Posted: 14th May 2009 23:29
The game runs like clockwork without the destroy script, but when I change it, all goes down the drain.


"Tempo non é só unha teoría, senón unha forza"
Try and figure it out
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 15th May 2009 06:48
Try toning the script down a bit. Like, get rid of the bloodspurt commands and things like that to see if you can get it to run faster.

It may be some of the visual commands causing the lag.


The one and only,


Login to post a reply

Server time is: 2024-11-25 01:59:32
Your offset time is: 2024-11-25 01:59:32