Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

WideWorldGames

5
Posts
2
Topics
A member registered Jan 23, 2020

Recent community posts

(2 edits)

Thanks for the response! I'm a bit of a beginner to buffers so I'm trying to understand - is this to say if I have 1000 instances of the same tree, I really only need to create the model (write the VBuffs) once and then create a system that can save and load this information on each subsequent iteration of the tree? I guess I'm asking how certain videos of this system can handle so many models at once without spending an initial 1+ minute on loading each room.

Any tips on where to get started would be really appreciated!

Edit: Also, oddly, when I change the models to 2d billboarded sprites, the game's slowdown is still very significant due to calling so many iterations of matrix_build each frame. Is this normal? I feel like I might be doing something wrong that's causing all this slowdown

My game rooms can have up to a few thousand models, which, to my understanding, shouldn't be a problem for the Fauxton engine. When writing to the static buffer, performance sits around 10-12fps for 30+ seconds every time you enter a new room.  Once the static buffer is loaded, game performance returns to normal. For a game with small rooms, that amount of loading would become a QOL problem very quickly.

It seems like most of the performance issues are being caused by the many iterations of buffer_write() - around 80-90% of the time taken to reach full 60fps is spent on buffer_write(). Is this normal and unavoidable given the amount of sprites I have in my room?

Thanks in advance.

Found it! I changed one specific _zs value within " __FauxtonWriteStaticSpriteStack" to 1 (bolded and commented below):

// Create and write to buffer (much faster than writing a direct vertex buffer)

for ( var i=0; i<_num * _zs; i+=1/_zs )

{

var _ind = ceil(i / _zs);

//if ( _ind > _num-1.6 ){ _ind = ceil(_ind); }

_ind = clamp(_ind, 0, _num-1);

__FauxtonWriteQuad(_buffer, sprite, _ind, _x, _y, _z + i + _zoffset, _col, _alp, _ang, _xs, _ys, 1)  //changed _zs to 1 here.

}

Hope this helps anyone facing a similar issue!

Doing a bit of a deeper dive, it seems like it only happens with the static buffer models, and not the original models. Going to check out some of those functions, and if I can't find a fix I'll see if my game can handle leaving the models in without creating static buffers (although I'd imagine this would cause a bit of a performance hitch down the line with large rooms)

(5 edits)

When creating my model (the exact tree sprite that comes with the demo), I notice that zscale is affecting the position of the object by making the base z position appear higher than its actual z position (double checked using debug messages upon creation). That is to say, if an object's z value is 64, and zscale is 1, the object will appear on the z-axis correctly, at 64. But if the object's z value is 64 and zscale is 2, the object will appear on the z-axis somewhere closer to 96 or so. I also notice that this gap is larger when the z value is larger, but only if zscale is above 1.

(edit: tested with zscale values below 1, and I can confirm that the objects' z positions appear lower than they're intended to.)

Create event: 

//var scl = (random number between 1 and 2)

//var z = (dependent on position, but often between 0 and 128)

// Create model

var model = fauxton_model_create(sprite_index, x, y, z, 0, 0, image_angle, scl, scl, scl);

fauxton_model_add_static(model, "PropBuffer");

// Cleanup

fauxton_model_destroy(model);

instance_destroy();

Any help is appreciated!