Object limit

Started by CaptainD, Sat 25/06/2016 21:30:38

Previous topic - Next topic

CaptainD

I haven't really been following all the different editor releases, I'm pretty sure this issue has been raised but not sure what the outcome was - is there an AGS version with a higher than 40 (or unlimited) object limit?
 

Cassiebsg

I know 3.4.0.x has removed a lot of limits (but can't remember which), try using the beta 3.4.0.8.
There are those who believe that life here began out there...

Danvzare

A quick search has just revealed to me that the limit still remains. Or at the very least, it wasn't removed in 3.4.0.* from what I could tell.

But even so, it shouldn't be too hard to download the newest version and create 41 objects, just to find out. It might be a little boring, but it shouldn't take more than a minute or two.

If the limit does still remain, you could always request that the limit be upped a bit.

arj0n

#3
Cap, v3.3.4.2 (Stable version - July 2015), v3.3.5 (Patch 2 & 3) & v3.4.0.8 (BETA VERSION - June 2016) do have the 40-room-objects-max limit.


Crimson Wizard

#4
I had a version that removes all the room limits, but it was never properly released. You may still find it in this forum thread, but it is severely outdated, and may contain bugs, so I won't recommend you use it.

Two reasons release did not happen:
a) I made a mistake of putting too much new stuff at once, many of which was not made well enough in my opinion, while there were only one or two persons who actually asked me for those limit removal; and then I had to switch to another tasks, like final 3.3 release.
b) The changes made in the engine required respected changes to Editor UI and probably redesigning room editor, which I could not do myself at that time.

I hope we will be returning to those tasks after actual 3.4.0 release.


PS. Also, please, you do not have to guess which limits are removed. Current system limits are listed in the corresponding manual topic. And all changes to the new version are noted in the release thread:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=53665.0

CaptainD

Many thanks to everybody for your replies. :smiley:

I think I will wait for a stable version with the object limit raised.  If the number raised to matters, for my purposes 49 would be great, 64 would be nice. 
 

Slasher

I remember i ran out of objects once. Painted on further object and used hotspots.

Danvzare

Hmm, I've just had a stupid idea. But couldn't you use characters as extra objects? :-\

Crimson Wizard

Quote from: Danvzare on Sun 26/06/2016 20:26:31
But couldn't you use characters as extra objects? :-\
Certainly. Room objects are inferior to characters in all aspects. I think the only minor disadvantage there is that you need to manage character view instead of choosing 1 static image for object.

CaptainD

#9
Quote from: Danvzare on Sun 26/06/2016 20:26:31
Hmm, I've just had a stupid idea. But couldn't you use characters as extra objects? :-\

Yeah I'd actually already started doing that.  It was just that I had refined my (very messy) code from earlier attempts and using characters as well stopped it from being very elegant.  I might just stop being lazy, go back and finish what I started... :-D


EDIT - ah, I think I remembered why I gave up on the idea.  Object clicks are processed in the room script, but character clicks are processed in the global script.  I wasn't sure in this case how to link in the global and room scripts.

Hmm... although technically for my purposes, I could simply have no interaction with the character, use a hotspot in the same location to process the click in the room script, and simply tint the character from the room script (as the tinting is really the only reason I need to use a character instead of simply a hotspot, as tinting works the same way for objects and characters).

If I'm right then you may see a devilishly difficult 7x7 grid on Colour Clash before long!
 

Cassiebsg

CaptainD, you could just "detect" and a if character do this, and if object do that... And you can process objects in global, only nag is that you need to use the object ID.
There are those who believe that life here began out there...

Crimson Wizard

#11
Quote from: CaptainD on Sun 26/06/2016 23:14:38
If I'm right then you may see a devilishly difficult 7x7 grid on Colour Clash before long!
For "tiled" puzzle games I could actually recommend to try scripting custom objects instead of using AGS room objects and hotspots, if you are not afraid of "paradigm shift" because that may end up even simplier and with far less restrictions.

CaptainD

Quote from: Crimson Wizard on Mon 27/06/2016 00:54:20
Quote from: CaptainD on Sun 26/06/2016 23:14:38
If I'm right then you may see a devilishly difficult 7x7 grid on Colour Clash before long!
For "tiled" puzzle games I could actually recommend to try scripting custom objects instead of using AGS room objects and hotspots, if you are not afraid of "paradigm shift" because that may end up even simplier and with far less restrictions.


I don't really think my AGS skills are good enough for this but I'll look into it - it could certainly make things easier and better if I could get it right.
 

Cassiebsg

Uhm? I don't even know what custom objects or "paradigm shift" are! 8-0
There are those who believe that life here began out there...

Snarky

A paradigm is a framework or way to look at the world, so a paradigm shift means having to think in an entirely different way.

CW is saying that instead of using the built-in AGS objects, you can write code to draw sprites and respond to interactions, thereby creating "custom objects" that you can fully control and that aren't subject to these limitations. This would change how you best approach the problem, hence a paradigm shift.

Crimson Wizard

rofl, I just decided to use a fancy word once :D.

Cassiebsg

Ah, okay, I thought it was code for some fancy coding that I knew nothing about. (laugh)(roll)

So, guess my next question is: how does one create custom objects? Is it using dynamic sprites? or something else I haven't become acquainted with yet?
There are those who believe that life here began out there...

Crimson Wizard

#17
Quote from: Cassiebsg on Mon 27/06/2016 18:59:08
So, guess my next question is: how does one create custom objects? Is it using dynamic sprites? or something else I haven't become acquainted with yet?


They may use DynamicSprites, but do not have to.
For example, this is the custom object definition in script:
Code: ags

struct MyObject
{
    int x;
    int y;
    int spritenum;
};

And the array of those objects:
Code: ags

MyObject objs[100]; // 100 is max possible objects
int object_count; // number of objects currently used

You will need to draw them yourself though, on some DrawingSurface. Like on room background, or on gui background.
Code: ags

DrawingSurface *ds = ... // assuming we got one somehow
int i = 0;
while (i < object_count)
{
    ds.DrawImage(objs[i].x, objs[i].y, objs[i].spritenum);
    i++;
}
ds.Release();

That's it, you have your own custom objects, that draw themselves, and completely not connected to anything built in AGS.



Regarding the CaptainD's game, I am not well familiar with it, but simpliest possible way to describe a tiled puzzle board in script is:
Code: ags

struct Board
{
   int width;
   int height;
   int cells[];
};

Where array of cells is created as
Code: ags

Board board;
board.cells = new int[width * height];

and each cell is an integer number which determines whether this is empty cell, or some type of puzzle item is inside, e.g. 1 - red item, 2 - blue item, etc.

Cassiebsg

Oh... I can see the possibilities! :-D

Thanks bunch CW! (I can see my friend twitching... "no, stop adding stuff to the game! I want to play it!") (laugh)
There are those who believe that life here began out there...

SMF spam blocked by CleanTalk