Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411507 Posts in 69374 Topics- by 58429 Members - Latest Member: Alternalo

April 26, 2024, 02:52:21 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The grumpy old programmer room
Pages: 1 ... 230 231 [232] 233 234 ... 295
Print
Author Topic: The grumpy old programmer room  (Read 738775 times)
Udderdude
Level 10
*****


View Profile WWW
« Reply #4620 on: October 10, 2014, 07:14:02 PM »

Fun with recompiling games for DOS using DJGPP and Allegro.  You never realize just how little you gave a crap about how much RAM you were using until you're back to trying to cram it all into 16 MB .. WTF

Yeah, my game uses 40MB of RAM which sucks =/ (although that's on a 64-bit system, on 32-bit Windows I get 24MB instead, which makes me wonder how much data got expanded in the process O_O

Sadly, unless you're doing it just for nerd cred, it's not really worth trying to do anymore ..

Your game looks like it could be rewritten for something much less intensive.
Logged
Sik
Level 10
*****


View Profile WWW
« Reply #4621 on: October 11, 2014, 11:16:34 AM »

And today I checked out of curiosity and noticed that RAM usage went down to 36MB (again, 64-bit build). And I didn't even do anything that would optimize RAM, and in fact it's loading even more stuff than since I last measured. Huh. I wonder if some library was optimized since I measured that.

I know that complaining about those sizes is stupid given how RAM is measured in gigabytes these days, but it's fun =P (also you should have seen people laughing at me when I said the game's site is large... because it's around 1MB total)
Logged
Boreal
Level 6
*


Reinventing the wheel


View Profile
« Reply #4622 on: October 11, 2014, 12:55:02 PM »

I miss my Game Maker/slow internet days where anything over ~5MB had to be really persuasive to get anyone to play it.  Thanks, MP3 files and bloated engines!
Logged

"In software, the only numbers of significance are 0, 1, and N." - Josh Barczak

magma - Reconstructed Mantle API
Martin 2BAM
Level 10
*****


@iam2bam


View Profile WWW
« Reply #4623 on: October 12, 2014, 09:51:46 PM »

Reviving old sources with new SDK/frameworks is a bitch.

I even had a space invaders clone I made for a Point of sale machine. Luckily I made a SDL port contemporarily back in 2004.
Logged

Working on HeliBrawl
Udderdude
Level 10
*****


View Profile WWW
« Reply #4624 on: October 13, 2014, 06:37:42 AM »

This JPG loading library I got for Allegro is loading the embedded EXIF thumbnails instead of the actual full sized image.  Am I a bad enough dude to learn about JPG file format and encoding to fix this sonofabitch?
Logged
ThemsAllTook
Administrator
Level 10
******



View Profile WWW
« Reply #4625 on: October 13, 2014, 09:01:23 AM »

Probably. libjpeg isn't enormously difficult to use.
Logged

Udderdude
Level 10
*****


View Profile WWW
« Reply #4626 on: October 13, 2014, 11:32:48 AM »

You were right, this is impossible w/o libjpeg.
Logged
Sik
Level 10
*****


View Profile WWW
« Reply #4627 on: October 13, 2014, 12:22:11 PM »

This JPG loading library I got for Allegro is loading the embedded EXIF thumbnails instead of the actual full sized image.  Am I a bad enough dude to learn about JPG file format and encoding to fix this sonofabitch?

What kind of broken library is that O_O
Logged
Udderdude
Level 10
*****


View Profile WWW
« Reply #4628 on: October 13, 2014, 12:36:54 PM »

A piece of crap.  I got rid of it.  libjpeg works great, I even found an Allegro wrapper for it.

Is it just me or have I completely lost track of how huge DOS .exes can get?  One of my games is 2.2 MB before compression.  I understand that DOS is not even close to what we consider an operating system today, and Allegro tends to include everything and the kitchen sink .. but damn.  That is a big .exe.

Looking back on it, the same game I compiled back in 2000 for DOS is half that size.  I guess Allegro and GCC w/ optimizations on is just a lot beefier now.
« Last Edit: October 13, 2014, 01:45:06 PM by Udderdude » Logged
Geti
Level 10
*****



View Profile WWW
« Reply #4629 on: October 13, 2014, 02:54:41 PM »

fwiw, if you're concerned about binary size, make sure you're compiling with -Os, and if you want to cut down on unused code from libraries, use some sort of dead code elimination (as you said you're using gcc, -fdata-sections -ffunction-sections at compile time, --gc-sections at link time) to eliminate the bits of the kitchen sink you don't need. Don't forget to strip debugging data. -fvtable-gc may also be useful if you're using cpp and going ham on virtual functions.
Logged

Udderdude
Level 10
*****


View Profile WWW
« Reply #4630 on: October 13, 2014, 04:28:30 PM »

I'm already compiling with -s and -O3.  I didn't know about those other ones, though.  It's probably fine since UPX reduces them to 630k or so.  That program is amazing at compressing executable data ..
Logged
Geti
Level 10
*****



View Profile WWW
« Reply #4631 on: October 13, 2014, 04:34:33 PM »

-O3 will inline a heap of stuff and can lead to executable expansion fwiw, but that'll generally compress ok so it's a possible good tradeoff. See if performance is ok with -Os though, I find the equivalent in VS is often good enough and compiles a little faster than the super-aggressive optimisation modes, not sure how that'd compare in gcc of course though Smiley
Logged

Udderdude
Level 10
*****


View Profile WWW
« Reply #4632 on: October 13, 2014, 06:40:57 PM »

Welp I'm a dumbass, I was using -s in the compiler options instead of the linker options.  The uncompressed .exe is down to 1.6 MB now. Shrug
Logged
Geti
Level 10
*****



View Profile WWW
« Reply #4633 on: October 13, 2014, 07:09:42 PM »

Haha, funny how one little thing can change so much Smiley
Logged

Sik
Level 10
*****


View Profile WWW
« Reply #4634 on: October 14, 2014, 11:34:16 AM »

Ouch.

Even then I remember Allegro having problems with that because just about everything would end up interlinked, bringing up tons of functions that would never get called in practice just because they got referenced internally in case some setting was used (even though the program doesn't use it). Optimizing out that stuff is not even remotely easy either, so the only feasible solution is to rebuild Allegro explicitly disabling the parts not needed, and then rebuild the program.
Logged
R.D.
Level 2
**


Making a game about balls. Yepp.


View Profile WWW
« Reply #4635 on: October 21, 2014, 02:28:47 AM »

Sometime ago I noticed strange lags in our game (web based game) and was eager to solve this. But there simply was no problem with the game. The code runs fine, V8 is having little workload and rendering is just fine to. It also shows the game runs at 60 fps and delta time is okay too. So we checked other games in the web (Treasure Arena, Elliot Quest) and found the same problems. Even at seemingly 60 fps, sometimes you see stutters. At first, I thought my PC was just overheating and throttling. But nope, it happens on full blown Desktop PC's too. I even know of other Operating Systems doing having this problem, but with less impact.

Now the fun part starts. From how it looks, this isn't the first time we had this problem. A year ago we had the same problem whenever a second monitor was plugged in. Not only canvas games, but also websites would start to have little/large stutters at random. Now what causes this problem? I'm not so sure it's an OS update. It would make sense, since we mostly get this problem on windows PCs. But we had it on a Mac too (Maybe it was just an old one, I don't know). It could also be a GPU Update. This is really frustrating since there's not much we can do about it. There is a pretty need site that can show the problem. Simple Sprite moving from the left to right at 60 fps and 30 fps.

Link: http://www.testufo.com/#test=framerates&count=2&background=none&pps=720

If you sometimes see stutters in the 60 fps section. Make sure to test the vertical scrolling too. You have that stupid problem too. Now we're trying to get in touch with people you might know more about this. I don't want people to get a bad idea of web games, because of this stuff.
Logged

Sik
Level 10
*****


View Profile WWW
« Reply #4636 on: October 21, 2014, 09:17:04 AM »

What are you using for timing? Because huh, that tends to be a serious issue. It's not about stressing the system but rather about how accurate is the browser when it tries to invoke your code.
Logged
R.D.
Level 2
**


Making a game about balls. Yepp.


View Profile WWW
« Reply #4637 on: October 21, 2014, 09:59:55 AM »

We simply use requestAnimationFrame. The way you should do it and the way it should work. And normally it works completely fine. As the linked page shows, this problem happens to multiple games/canvas apps. It's a problem that sits deeper. It comes close to micro stuttering. Something that mostly happens because of multiple monitors or Dual-GPUs. It seems that this is a not a new problem so we created an issue for the chromedevs. Hopefully this starts a deeper investigation of the problem.

Check out the issue here: https://code.google.com/p/chromium/issues/detail?id=425593&thanks=425593&ts=1413909037
It helps a lot if you start so the devs take notice. This is a problem that needs fixing sooner or later, as it will affect players.
Logged

tjcbs
Level 1
*


View Profile WWW
« Reply #4638 on: October 21, 2014, 12:09:41 PM »

I've given up on web games and refuse to play them because of this exact issue. That page stutters for me, and I have only one monitor and gpu. And it certainly looks like "macro stuttering" to me.
Logged

Boreal
Level 6
*


Reinventing the wheel


View Profile
« Reply #4639 on: October 24, 2014, 02:55:50 PM »

OpenGL is drawing everything correctly.
Start adding new feature, leaving everything else pristine.
OpenGL isn't drawing anything now.
Comment out new feature.
OpenGL still doesn't draw anything.

Every god damn time.
Logged

"In software, the only numbers of significance are 0, 1, and N." - Josh Barczak

magma - Reconstructed Mantle API
Pages: 1 ... 230 231 [232] 233 234 ... 295
Print
Jump to:  

Theme orange-lt created by panic