The Daily Click ::. Forums ::. Klik Coding Help ::. TGF Max number of objects
 

Post Reply  Post Oekaki 
 

Posted By Message

Robageejammin



Registered
  21/03/2005
Points
  17
15th April, 2005 at 11:13:06 -

Just wanted to know if there was any way to change how many objects could be on screen at once. Like if it can go past 260 or whatever it is.

 
This curse is more cursedly curse-worthy than any curse that's ever cursed you!

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
15th April, 2005 at 11:48:56 -

Nope, you can only change that in MMF.

 
a/n

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
15th April, 2005 at 12:10:17 -

Nope, sorry. However, you *can* use a few tricks to optimise the object limit.

For example. In your standard scrolling game, there are may well be several types of object, and several indstances of each. Eg:

Coins: 50
Enemies: 10
Extensions, etc: 10

That's 70 objects taken up already - many of which probably aren't on-screen at that time. So we only have 190 more objects we can display.

So what you can do is have a list object and create a process that cycles through every object (using fastloop) and checks their coordinates - if they're offscreen, it adds their coordinates and other data (direction, important values like health and ammo, etc) into the list, then deletes that object.

Now you have a list object with about 70 items in it. But because those 70 have been deleted, we now have the full 260 to use. As the player moves around, another fastloop process now and then can check where objects need to be, and then create them once they're on-screen.


Of course, you'll never have the FULL 260 available to you, because extensions (such as the List Object) take up a bit of your object limit, and you'll still have the player object and any detectors, score objects, string objects, etc. But you should still end up with about 240 left to play with.

 
191 / 9999 * 7 + 191 * 7

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
15th April, 2005 at 12:10:25 -

TGF object limit: 256 (i think)
MMF object limit: 10 000

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14560

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
15th April, 2005 at 13:54:06 -

I believe the limit is for TGF is 262.

You could always create new objects at runtime, if you make a few objects that create collectables when the character reaches a certain point you can have as many as you want.

Say you have 100 coins in a level, when your character reaches halfway you can destroy all coins (to get rid of any leftovers) and use these objects to create new coins, Creating each coin one by one in the events editor is a pain so you could have a blue square which turns into 10 coins in a row and a red square to turn into 30 coins etc.

Still using the list object and fastloop sounds even better, but my method is easier.

 
.

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
15th April, 2005 at 16:30:08 -

Phizzy,
http://www.create-games.com/forum_post.asp?id=117654
chop chop!

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14560

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
15th April, 2005 at 20:47:29 -

Phizzy, test it mate, you will find it is actually 262, unless there is some hidden reason why its not that only tigerworks would know of.

 
.

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
15th April, 2005 at 21:29:56 -

Maybe that only applies on the 16-bit version. It's 262 for me.


(by the way, not even tigerworks is l33t enough to h4xx0r teh sources to TGF and find out why.)

 
n/a

Teapot

Does he even go here

Registered
  02/10/2003
Points
  2631

VIP Member
16th April, 2005 at 00:53:57 -

Awesome avatar, Mr Smith. Robageejamin Smith, that is.

 
n/a

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
16th April, 2005 at 09:57:09 -

I think the limit is defined as 256 (its a nice round number for programmers anyway), but due to different objects counting as different amounts of objects, quirks in TGF etc. in practice you can go up to 262.

 
- Tigerworks

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14560

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
16th April, 2005 at 13:36:58 -

I never though about the differences in 16 and 32 bit modes.

 
.

Robageejammin



Registered
  21/03/2005
Points
  17
16th April, 2005 at 19:01:15 -

Ah ok, thanks. All good advice but the kind of game im doing requires all those objects on the screen at once. Im making a snake with a cool kind of movement using the premade race car movement for the head and creating a circle with a shrinking animation at the head for every millisecond. Ill live if i cant do it though. I was really just messing around.

And thanks teapot. For some reason it gets all crusty looking on this site.

 
This curse is more cursedly curse-worthy than any curse that's ever cursed you!

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
17th April, 2005 at 05:53:35 -

milliseconds?...
TGF's event loops are 00:02...

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
17th April, 2005 at 13:23:15 -

2 milliseconds is 00:002 not 00:02
milli=thousand

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
17th April, 2005 at 17:00:04 -

Man, Aggggge, don't you listen?

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
18th April, 2005 at 08:14:06 -

no... who wants to listen to you?...

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
18th April, 2005 at 08:18:16 -

I didn't ask you to listen to me as I didn't have anything interesting to say in that topic (which is unusual, as everything I say is interesting). However, you didn't listen to Phizzy who clearly said 20.

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
18th April, 2005 at 08:23:02 -

he didn't SAY 20 he WROTE 20
and also i hate you BOOHOOHOOOOOOOO!!!!!

 
n/a

Robageejammin



Registered
  21/03/2005
Points
  17
18th April, 2005 at 13:00:54 -

T_T

umm, all i meant was it [always] makes an object at a certain point. I know its crazy but its just used for a special effect.

 
This curse is more cursedly curse-worthy than any curse that's ever cursed you!

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
18th April, 2005 at 20:21:58 -

I don't know what they taught you in sex ed. but you can't have two fathers. Well, biological, anyway.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14560

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
19th April, 2005 at 10:26:14 -

can you have three then?

 
.

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
19th April, 2005 at 12:02:28 -

Technically you still have two, so no. AND YOU'RE OFF TOPIC

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
19th April, 2005 at 12:35:34 -

i had to scroll to the top of the page and check what the topic was now again

 
n/a
   

Post Reply



 



Advertisement

Worth A Click