Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Beta testing for BrazSonic 2, for troubleshooting - new build released


Godmaster

Recommended Posts

Today, I got a big problem with my game, BrazSonic 2, after implementing the Dami' Grid Spatial Engine to avoid slowdown problems with static instances overload, and I almost successfuly I merged that with the traditional object deactivation to "unload" the outview non-static instances.

Cool, this worked out, but without explanation, after compile that to an EXE, my game now runs at 30 fps even to my new Core2duo (that used to run at 60fps with few interruptions).

I got really mad, and I asked few people to test that. The slowdown also happened to them, consuming a lot of memory(the half of a whole RAM)...

I really don't know why this insists (or what voodoo someone is using against me >_<), but I suspect:

-by preloading sounds

-by don't preloading most of sprites

-by having a lot of resources inside of the project (even with the external ones)

-the grid spatial engine doesn't work properly at the same time of instance_deactivate_region

-by having lots and lots of separated sprites for the characters (instead of one with tons of frames)

-by loading external resources

-by software bloat

-by only calling code via scripts (specially for the character and hud events, that its create,step,etc only use scripts with tons of code)

-by having lots of different tiles in a same room (using several sizes)

-by, oh.... whatever...

Warning:

There's the current version for testing, I recommend running only if you have a good PC, because, as I said before, this consumes almost a half of an entire memory, specially after the first cutscene that takes even more...

http://rapidshare.com/files/86845897/Brazsonic2_jan.rar.html

LATEST BUILD (February): http://www.mediafire.com/?dw0twxfuz29

Ah, before testing, here's the controls for any character:

Movement: arrows

Jump: D

Primary attack: A

Secondary Attack: S

Cancel Grappling: W

Spindash: D+Down

Change Character:1,2,3,4(incomplete)

Skip room: "N"

Also, there's a support for joypad

I've been programming this for almost 3 years, and I had to remake the engine two times. Why that's happening to me? Where I did wrong?

Link to comment
Share on other sites

I have 2.80 GHz and 512 MB of RAM. I don't know if this is considered good enough, but the Brasonic 2 SAGE demo worked perfectly, without a single slow-down.

I'll see what happens. Once I'm done, I'll post here again.

(It might take a long time, I'm with a dial-up thing right now)

  • Like 1
Link to comment
Share on other sites

What do you do at the very beginning of the game? Monitoring my Physical Memory usage, it was about 200MB when the Game Maker loading screen finished, then in like 5 seconds it shot up to 1GB and didn't stop. Seems like there's no way you could be loading resources that fast, so maybe it's a memory leak.

Link to comment
Share on other sites

Could you reuploud it somewhere else for example mediafire.com or host-a.net? Because I need to wait 200 minutes till I'll be able to download from rapidshare.

Edit: Just downloaded and played it. My computer surprised me once again the average fps was 50-60 it ate only 256mb of my ram. Not bad for a 1.8ghz processor and 512 ram, huh? The lowest fps was 4 when the room was loading then everything else worked really nice.

  • Like 1
Link to comment
Share on other sites

What do you do at the very beginning of the game? Monitoring my Physical Memory usage, it was about 200MB when the Game Maker loading screen finished, then in like 5 seconds it shot up to 1GB and didn't stop. Seems like there's no way you could be loading resources that fast, so maybe it's a memory leak.

That shots up to 1gb when you just start a level? Yeah, some people noticed that and this usually crashes the application...

Well, in my resources I use to do:

-preloading sound effects (all of them are wav, this shouldn't be a good choice)

-preloading player, enemies and non-static objects sprites (there lots to them, specially to the enemies)

-I load external backgrounds, err... fake sprite-based backgrounds, because in fact they're just animated gifs with few frames (each frame as a "background")

And... I almost forgot

If I use tilesets instead of separated level components and mp3 instead of wav(preloaded or not?) that could be use less memory?

Link to comment
Share on other sites

Oh man!

I found out a big reason that had eaten a lot of memory in my game. I used to load external big images without unload/delete them after end the room that they were applied.

So, I did that, and worked well. The memory usage decreased from 1GB to 400/500MB. Now I need to deal with the internal resources.

So, using tiles instead of separated sprites, and mp3 instead of wavs, could use less memory?

Link to comment
Share on other sites

Tiles vs objects: Tiles are better for speed and memory. Exactly how much memory, I don't know. When I created a room and then created 1,000 objects when I pressed space after the memory leveled out, the memory lost about 250 KB (or 250 bytes per object). When I created 10,000 objects, the memory lost about 28 MB, or roughly 3 KB per object. These values don't care whether the object is deactivated or not. So it's probably not a good idea to have more than a thousand objects exist at the same time as their space usage very quickly gets very much less efficient. Which is another reason why you should use Dami's method which destroys and creates objects, freeing their memory when not in use (or rather, compressing them to a few simple values), whenever possible.

Oh, and 100,000 tiles used less than 10 KB of RAM. So... yeah.

MP3s vs WAVs: I have no idea. I kinda think MP3s are like PNGs in that they have to be decompressed then stored in memory to run real-time. In that case it sounds like they'd be equal except that WAVs are more likely to be stored at lower rates (and therefor use less memory). But I think a sound system is quite a bit different than a graphic system. I'll be sure to let you know if I can figure anything out, though.

Anyway, nice to hear you help your situation at least a little.

Link to comment
Share on other sites

I can't even play this. Once it gets to the screen with Sonic and friends on the beach, the keys don't work anymore. Eventually it will go on to the level, but the keys still don't work.

Oh crap, I didn't change the key to skip that >.<, you just need to press enter to do. But, even with enter that doesn't work?

EDIT:

I just released another version, without Grid Spatial Indexing, and with less memory usage (now unloading unused external stuff). This isn't the official DEMO, so I'm not divulging that to everybody.

http://www.mediafire.com/?5nyewtvwynm

I don't know if this will run at better FPS, because I didn't changed anything in object deactivation (I have to do that yet).

Link to comment
Share on other sites

Well, the RAM usage shot up to max. The FPS was too low.

I'll try the version without Grid Spatial Indexing and see what happens.

And, you should consider using ogg files, like kirbyhi5 says. They have good quality and the size is convenient.

Link to comment
Share on other sites

Tried the new version. Keys still don't work.

Neither enter, nor space? Anyone more had the same problem? Next version I'll upload without cutscenes.

It still uses some 350 MB, but still it's running 100% better on my computer than before. I don't know how it changed with regards to FPS since the last version used way too much memory to get that far.

Maybe it happens because the scenery sprites, I'll try using tiles and standard solid objects (for masking) instead of lots of objects (every level uses different objects). Maybe external tiles to save memory.

make sure the program your using can support .ogg's though. MMF2 and GM can I'm sure.

Nope, they don't have, but the supersound.dll can resolve this problem. Do midis eat too much memory, like wavs? If it does, I should convert them to mp3 or ogg?

Link to comment
Share on other sites

You can't really convert MIDIs to MP3s or OGGs, since MIDIs are like sheet music for the computer, while MP3s/OGGs are actual recordings of sounds. I don't think MIDIs are causing your problem though, although they might cause a slight pause everytime they're loaded, depending on how your program handles them.

Link to comment
Share on other sites

You can't really convert MIDIs to MP3s or OGGs,

In theory, you could.

Simply open up a sound program that can record sound through Line Out (Audacity can do this, and it's free) and play the MIDI within your MIDI program while the program records.

This would be impractical, however. Since MP3s and OGGs take up alot more space and memory than a MIDI, and the newly recorded file would still sound just as lame as the original MIDI.

@Godmaster: What program did you use to make this game? I'm considering giving it a run, but if it's clocking in at 350 MB then that's more than my crappy computer can take. (Sonic Blitz runs at around 63 MB, and my computer hiccups a fair amount just from that)

Link to comment
Share on other sites

@Godmaster: What program did you use to make this game? I'm considering giving it a run, but if it's clocking in at 350 MB then that's more than my crappy computer can take. (Sonic Blitz runs at around 63 MB, and my computer hiccups a fair amount just from that)

I actually use Game Maker 7, and I noticed that the gm games memory usage varies on your ram, when I tested on my other pc of 512MB of ram before.

It ran at my newer of 2 GB on 1GB and at the older at 250-320 of RAM. I tested that before I released this lighter version.

This would be impractical, however. Since MP3s and OGGs take up alot more space and memory than a MIDI, and the newly recorded file would still sound just as lame as the original MIDI.

Really, I thought that mp3 use to consume less memory than waves, by doesn't using the same driver to be loaded.

Simply open up a sound program that can record sound through Line Out (Audacity can do this, and it's free) and play the MIDI within your MIDI program while the program records.

What a shame, I just saw that Adobe Soundbooth doesn't support OGG, but supports WMA, also lighter tham MP3^^.

I should use OGG or WMA?

Link to comment
Share on other sites

Damn, in some computers, like the Spike one, it crashes before the first level starts. I don't know why that still happens... even with less weight on the project, like tiles instead of scenery objects, instance deactivation, no draw events for outview objects...

I still don't know if I preload or not those invisible solids, that wouldn't make any difference on memory usage because once they are loaded, they can't be unloaded...

I really don't know why this happens, this make me feel like to stop to work on this game, that I made, remade, etc for almost 3 years. This is very disgusting for me when I think that all of this work wouldn't has any return...

Damn.

Link to comment
Share on other sites

The lighter version used 130 mb of ram. But for some reason it started running using only 43mb of my ram when I was playing act 2. Btw super sound dll doesn't work properly on gm7.

I had tested that in GM7 a GM5 version of supersound.dll, and worked fine for me. Maybe I use that for every sound effect, that will be external now.

And I was talking to MSUK, and he said that he uses one sprite with all character animations for Player object. Maybe this can work for me, but I won't do only one for loading animations, because there's more than only one character, and there's some sprites using bigger dimensions (like swinging ones). Maybe with few sprites I can save memory.

I really need to clean lots of garbage in the Character and HUD codes, the main reason for FPS decreasing.

And, I decided to make most of resources external. Yes, this can ease the work from people who use sprites without permission, but they could steal even protected stuff anyway. I don't care about them. Also this could be a funny idea to customize the game, like an open-source.

Link to comment
Share on other sites

Well maybe the gm5 version works on gm7. But the current version doesn't work as I've tested it and the creator said that its a bug. Btw if your still going to use gm making this then I suggest doing some encryption on your game's exe because there is a decompiler alert.

And I was talking to MSUK, and he said that he uses one sprite with all character animations for Player object. Maybe this can work for me, but I won't do only one for loading animations, because there's more than only one character, and there's some sprites using bigger dimensions (like swinging ones). Maybe with few sprites I can save memory.

The older Damizean's engine uses this method, so give it a try.

Link to comment
Share on other sites

Well, I got a cool idea to make the project even softer, now for solid static objects, I made an separated object that loads an external tileset that place tiles for them.

I'm literally "plucking the feathers" of my game, to find out the bugs to fix them, and to erase useless code. But now, some questions are disturbing me...

- what's the best image kind to load? BMP, PNG or GIF?

- only one object for all characters (with every code inside, including the draw events) works slower than a player object for each character?

- I use to draw parallax backgrounds using draw_sprite instead of draw_background, because I load the background parts from an animated gif. Is this correct?

-multiple parents works slower than separates collisions? like this hierarchy: solid > walls > platform

-some of last complains about its running wasn't about the ram, was about the processor usage from the game... that wasn't supposed to consume 100% of the CPU... (you notice that I you're running on an 1.8 Ghz processor).

-I'm gathering all level tiles into only one tileset depending on their dimensions. For instance: I have for each level 32x32 tileset, now I'm put all 32x32 tiles in a single tileset, to avoid loading tons of tilesets. I'm doing right?

Well, these all are my questions for now... thanks in advance ;)

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...