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.

Code Snippets / Count objects in game

Author
Message
Drew Cameron
20
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Scotland
Posted: 6th Jul 2005 19:24 Edited at: 7th Jul 2005 06:14
Here is a snippet to count how many objects are in your game, and print the total.

Put this in your loop. SPACEKEY performs the count.



I suck.

Dumbo and Cool

WIP Board!
Eddie B
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 7th Jul 2005 01:11
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 7th Jul 2005 01:48
Why did you choose 25000 is that the limit of objects allowed in DB?


Current Projects: SHADE - Game Maker | Mecho - TGC Puzzle Entry | Halo Physics Engine | COLD - Polygonal Collision Detection
Drew Cameron
20
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Scotland
Posted: 7th Jul 2005 03:01
I don't know what the actual highest number is, 25000 is the highest object number I've ever used is all.

I find it useful for targetting which levels in a game are more object heavy than others and so you know which ones to strip down so everything is equal.

Dumbo and Cool

WIP Board!
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 7th Jul 2005 04:53
65535 I believe is the highest.

[url]andrewneale2004@yahoo.com[/url]
http://www.elbsoftware.dbspot.com
Drew Cameron
20
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Scotland
Posted: 7th Jul 2005 05:47
Very well. Edited.

Dumbo and Cool

WIP Board!
Eddie B
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 7th Jul 2005 05:49


Drew Cameron
20
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Scotland
Posted: 7th Jul 2005 06:14
Yeah, ie crashed on me and I forgot I was going to edit it. Edited now.

Dumbo and Cool

WIP Board!
AndLabs
19
Years of Service
User Offline
Joined: 7th Dec 2004
Location:
Posted: 7th Jul 2005 06:36
Yeah, if you looked at the docs for MAKE OBJECT and the LOAD OBJECTs, you'd see the 65,535 object limit - and that is so sweet!

Nice, but a little slow on the processor if you got a lot of objects or are doing a lot. Why not ask the guys at TGC to add a COUNT OBJECTS() function that returns the number of existing objects?

For the Software You Want, AMPERSAND LABORATORIES is the place! [URL=http://www.andlabs.com/]
[/URL]
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 7th Jul 2005 22:25
I asked a while back, they said no


Current Projects: SHADE - Game Maker | Mecho - TGC Puzzle Entry | Halo Physics Engine | COLD - Polygonal Collision Detection
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 7th Jul 2005 22:29
If you wanted to make it a little more efficient you could add:

- The system finds which numbers are objects and which are blanks, since people sometimes make objects from 1 to 10 then suddenly jump to making objects from like 30 to 40.

- Just save the numbers to a text file and then execute the text file when the prog is done.


Current Projects: SHADE - Game Maker | Mecho - TGC Puzzle Entry | Halo Physics Engine | COLD - Polygonal Collision Detection
Drew Cameron
20
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Scotland
Posted: 7th Jul 2005 23:01
Yeah, just add a "print checking" into the for-next part of the snippet and you'll get a printed list of all used object numbers.

Dumbo and Cool

WIP Board!
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 7th Jul 2005 23:54
I know just suggesting for you to add it for people who may want to know how.


Current Projects: SHADE - Game Maker | Mecho - TGC Puzzle Entry | Halo Physics Engine | COLD - Polygonal Collision Detection
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 8th Jul 2005 01:49
Actually object numbers I believe can be in the millions..


"Lets migrate like bricks" - Me
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 9th Jul 2005 00:22
He's right you know. In DBC you were limited to about 65,000 and something. In DBP it's a WAY bigger number.


You are not alone.

Login to post a reply

Server time is: 2024-11-23 11:29:58
Your offset time is: 2024-11-23 11:29:58