Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Limits... #66786
03/16/06 02:10
03/16/06 02:10
Joined: Apr 2005
Posts: 33
C
Cyrus Offline OP
Newbie
Cyrus  Offline OP
Newbie
C

Joined: Apr 2005
Posts: 33
Hi! I am making a game not unlike Diablo 2. As such I need a script to handle the monsters.

My thoughts on the subject would be to create a global variable at 0 by default, when the game loads. This variable would be the current number of monsters in the area. As you move through the area, it will randomly create monster entities, going through random numbers to decide which kind of monster to spawn.

Depending on a variable loaded with each level, the max amount of monsters is created (not the exact second) as soon as you enter, so the monsters are placed before you have a chance to move.

What I had planned was, for each monster, a function checks the current number of monsters in the map, adds 1, and creates a variable for each of that monsters stats, health, etc. based off of that number.

So, if there are 23 monsters in an area and the enigine is about to make the 24th, it creates a variable named something like Health.Monster.24 and so on. After it's done, it adds one to the global variable, so the next check starts at 25.

My question is, is this too many variables for GS to handle? I know it can handle a fair amount, but were talking about maybe 700 variables created (not at once) pretty close to each-other. Is there a quicker way?

I also thought I might make the monsters as you walk through the area, or based on the time you've spent there, and when it reaches the max monster limit, it would stop creating them.

I would like to know which method you guys think would work better, and whether I am completly wrong on this topic or not. I also need a method to make sure that they don't spawn in walls or the character, but I can't even imagine how i would do that, short of shooting a ray (invisible, of course) from the player in all the directions and creating them that way, but wouldn't that make them spawn close to the character?

I really need a new way to check for collisions when they are spawned. Any comments or questions are more than welcome.

Cyrus


Cyrus.TurnInto OBJECT_CYRUS_DOLL, CyrusDoll DummyEffect CyrusDoll, Body, FIRE, TRUE CyrusDoll.SetScared TRUE CyrusDoll.RunTo CIRCLES TakeObjectFromHero OBJECT_DIGNITY Target.Kill Hero CYRUS, SLOW SetFlag PNWED, TRUE
Re: Limits... [Re: Cyrus] #66787
03/16/06 03:28
03/16/06 03:28
Joined: Nov 2003
Posts: 1,257
Wade_Adams Offline
Serious User
Wade_Adams  Offline
Serious User

Joined: Nov 2003
Posts: 1,257
I would advise spawn areas where you would want them and have a funtion spawn them until you have enough. i would do this on level creation then the monster can do what you specify from there...


Optimism is an occupational hazard of programming: feedback is the treament.
Kent Beck
Re: Limits... [Re: Wade_Adams] #66788
03/16/06 03:44
03/16/06 03:44
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
3dgs can handle pretty much whatever you throw at it. I've used arrays 4000 and higher, and I've heard of people using 10,000 and higher.

My game "tower" can have over 300 entities on the screen when the tower reaches the top. 3dgs handles it quite well.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: Limits... [Re: FoxHound] #66789
03/16/06 04:17
03/16/06 04:17
Joined: Apr 2005
Posts: 33
C
Cyrus Offline OP
Newbie
Cyrus  Offline OP
Newbie
C

Joined: Apr 2005
Posts: 33
Thanks, I appreciate the help, guys.


Cyrus.TurnInto OBJECT_CYRUS_DOLL, CyrusDoll DummyEffect CyrusDoll, Body, FIRE, TRUE CyrusDoll.SetScared TRUE CyrusDoll.RunTo CIRCLES TakeObjectFromHero OBJECT_DIGNITY Target.Kill Hero CYRUS, SLOW SetFlag PNWED, TRUE

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1