Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: .png or .bmp background loading from external source?  (Read 5095 times)

0 Members and 1 Guest are viewing this topic.
.png or .bmp background loading from external so...
« on: March 16, 2012, 10:50:05 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 262
When I started on this project GameMaker did not yet have the function to load .png files as a background. ( yes that was along time ago ) Since then I created 400+ .bmp background files. ( 128 x 160 pixels )
For the dungeons I am using .png files as they make the total game download a lot less large.
Before I start saving all of those files to .png and change all the room creaton codes to load .png in place of .bmp I have one question. Does gamemaker actually work faster with .png or doesnt it matter that much. I'm talking about a lot of work when having to change everything so I prefer to be certain it it actually would improve things other then just the filesize of the total game external resources?

Code: [Select]
global.bg_background=background_add('Bgd_Overworld\lucht\lucht39.bmp', false, false,);
bg_background=global.bg_background

background_index[0]=bg_background;
« Last Edit: March 16, 2012, 11:11:07 pm by Atomicd1 »
Logged
Re: .png or .bmp background loading from externa...
« Reply #1 on: March 16, 2012, 11:36:00 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
1) Even if it would take a lot of time, you should definitely change the files from BMP to PNG.

2) Why are you saving each area map as a background image, instead of using tilemaps?
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: .png or .bmp background loading from externa...
« Reply #2 on: March 17, 2012, 07:56:28 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 262
3 reasons,
- using tilemaps means having tilesets in gamemaker which makes that file a lot larger, gamemaker itself opens slow if it becomes a large file.

- Tileset rooms load a lot slower when you have hundreds of rooms then when the background comes from an external source.

- I dont like the editor used in gamemaker, paint works a lot faster. you can copy and past one corner into several rooms a lot faster then you can put something together in gamemaker.
Logged
Re: .png or .bmp background loading from externa...
« Reply #3 on: March 17, 2012, 01:41:03 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
While keeping assets outside of the executable is always a wise idea, storing them as a series of complete image files is not.  In reality, you are essentially saying "I want to reduce the file size of the EXE" then merely increasing the file size of the assets.

If you are set on keeping the room data completely external, I would recommend using GMare, which (if I understand correctly) has the ability to save to external binary map files.  The difference in loading time between tile maps and static backgrounds is not so great as to cause any performance issues, and tilemaps will take up less disk space and less memory during run-time.
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: .png or .bmp background loading from externa...
« Reply #4 on: March 17, 2012, 02:13:58 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 262
well, I've spend about 4 hours and now all .bmp is .png. The backgrounds now have a total filesize of 7.5 MB, the game itself currently is only 800kb, though I expect it will be double that size when I'm completely done with everything.  The only think not yet counted for is the background music, but I dont have that part ready yet. But Looking at the numbers I dont think its too much for a zelda fangame that has a large setup like this one.
Logged

thestig

Re: .png or .bmp background loading from externa...
« Reply #5 on: March 17, 2012, 02:27:48 pm »
I'm gonna have to be with MiN on this one. You're actually taking a bad step with this. Tilemaps only reference the tiles location on the tileset, so therefore at runtime and probably on the hard disk itself, is going to be smaller than an image. Suppose you have a map that's roughly about 2500x2500 in size. For each pixel, you have to account for all primary colors + alpha channel if that's enabled versus having to care about only x,y values. I'm gonna call to question maintainability. What would you do if you had to change a section of the map? I mean.. idk. You _still_ have to have a normal "map", though. How are you going to track object locations on the background? You're creating extra steps for something that should've been simple. Another point, what about using the same tileset for multiple maps? Which nothing stops you from doing that. Now with your current setup, you're forced to resort to redundantly storing data.

Honestly, if you refuse to take my advice then that's your choice. All I'm saying is, MiN's trying to point out to you that you're creating double the work for yourself and in time, what you're trying to achieve will only fail because tilesets + maps are less smaller than background images + maps. Another thing, why do you care so much about the executable size? Shouldn't there be other things you should be worried about? i.e. How efficient your engine is? But of course, loading in bigger textures is the more efficient way to go, according to you. Have you considered to think that you would fall into the whole memory fragmentation problem by loading in the same thing more than once?
Logged
Re: .png or .bmp background loading from externa...
« Reply #6 on: March 17, 2012, 02:41:36 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 262
But eh, why would I have to change a part of the map? Every part of the map is completely done.
That counts for overworld,dungeons, houses and cave maps. and tracking object locations, thats not a problem at all, considering I dont use views so each part is a new room there isn't that much space where an object can be.

And about the memory problem, you got to have a very crappy pc/laptop if its memory can't handle this game. As I've said this project is rather old already and with 400 rooms walking in and out them, loading more and more backgrounds I didnt  experience problems when testing it on a 9 year old pc.

Your right that it might be more efficient to do it the other way, but gmare did not even exist when the main overworld was created. I dont feel like having to make it all over again.

( an efficient engine is a small engine, so yes the size of the executable does matter )

Yes I may seem a bit stubborn, but be glad about that, its one of the reasons that this project will actually be completed.
« Last Edit: March 17, 2012, 02:55:53 pm by Atomicd1 »
Logged

thestig

Re: .png or .bmp background loading from externa...
« Reply #7 on: March 17, 2012, 02:59:34 pm »
But eh, why would I have to change a part of the map? Every part of the map is completely done.
That counts for overworld,dungeons, houses and cave maps. and tracking object locations, thats not a problem at all, considering I dont use views so each part is a new room there isn't that much space where an object can be.
Your game isn't finished. Isn't it? Don't rule out that things can change or unless you're going to ship the project with mistakes. But even still, you're storing data redundantly causing more overhead than what there should've been. One tileset could cover an entire overworld. With your approach, for each section of the overworld you have split up, it will take more than double the amount of resources to draw the same exact thing. How do I know this? Its just common sense. A small array of 16x16 tiles is significantly smaller than an array of " 128 x 160 pixels ". Jeez, I sound like a bad translation now.

Quote
And about the memory problem, you got to have a very crappy pc/laptop if its memory can't handle this game. As I've said this project is rather old already and with 400 rooms walking in and out them, loading more and more backgrounds I didnt  experience problems when testing it on a 9 year old pc.
Oh I'm sure you'll cause some GPU drivers to flip out. I'm specifically pointing to the AMD/Intel department here because as I recall, three projects from this site has caused my machines to crash and they utilized a method very similar to yours. A little debugging pointed that the fault was at the driver not managing the memory right.
Quote
( an efficient engine is a small engine, so yes the size of the executable does matter )
No, no, no, no. You're using GameMaker. It was designed for rapid development and honestly, wasn't really designed with efficiency in mind. Just look at its alternatives: Java and C#. I would rather see people take those any day. You want to worry about the size of executable? Go native and manage your resources yourself. Also, just out of curiosity, how much RAM does your game consume when it runs? I'm assuming a lot because of GameMaker's loader storing the GMK in memory at runtime, among other things.

Trust me man. If your method was more efficient, game developers would've taken your approach a looooonnng time ago. This has been a problem that still is visited today and innovation continues. i.e. ID's megatexture technology. Sure, it applies to a 3D Game Engine, but my point still stands: your method is not efficient as you claim. Though you are right that a small executable is efficient in the distribution sense. Less bandwidth required to distribute it, I guess.. but that's negligible in comparison to RAM and VRAM or CPU/GPU bottlenecks.

EDIT: By the way, where is your fan game anyways? O_o I'm actually rather curious to try it out. But I'm gonna shut up about the whole efficiency thing. Cause it really is your project.

And you could've used a batch script to convert all of the files for you(or unless you hand-tuned them all?) to speed up the process of conversion, rather than spending 4 hours doing it. :S I wish I would've saw this earlier cause I could've helped you there.

EDIT 2: Nvm, found it. ;p
« Last Edit: March 17, 2012, 03:09:25 pm by gm112 »
Logged
Re: .png or .bmp background loading from externa...
« Reply #8 on: March 17, 2012, 03:40:44 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Posts: 728
Quote
Your right that it might be more efficient to do it the other way, but gmare did not even exist when the main overworld was created. I dont feel like having to make it all over again.

You may get lucky, if your overworld can be made into a .bmp or .png, GMare can convert it to a room and a tileset. You can even move the tiles around to make your own custom tileset out of it. Then you wouldn't have to re-tile the whole thing.
Logged
  • Pyxosoft

thestig

Re: .png or .bmp background loading from externa...
« Reply #9 on: March 17, 2012, 04:05:10 pm »
Quote
Your right that it might be more efficient to do it the other way, but gmare did not even exist when the main overworld was created. I dont feel like having to make it all over again.

You may get lucky, if your overworld can be made into a .bmp or .png, GMare can convert it to a room and a tileset. You can even move the tiles around to make your own custom tileset out of it. Then you wouldn't have to re-tile the whole thing.

That is pretty freakin awesome, Darth Xfixium. :P
Logged
Re: .png or .bmp background loading from externa...
« Reply #10 on: March 17, 2012, 05:06:46 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 262
But eh, why would I have to change a part of the map? Every part of the map is completely done.
That counts for overworld,dungeons, houses and cave maps. and tracking object locations, thats not a problem at all, considering I dont use views so each part is a new room there isn't that much space where an object can be.
Your game isn't finished. Isn't it? Don't rule out that things can change or unless you're going to ship the project with mistakes.

I split the game creation into several parts, one first part was making a very detailed drawn map  and a lot of notes of what was to be done in every room. After that the overworld map was made, its considered a final version now. ( yes I had to fix a few rooms in it during the testing of it )

and about memory usage, its at 28.612 kb memory usage after 15 minutes of playing. Thats not bad I think.
Logged
Re: .png or .bmp background loading from externa...
« Reply #11 on: March 18, 2012, 12:49:54 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Quote
and about memory usage, its at 28.612 kb memory usage after 15 minutes of playing. Thats not bad I think.
Are you sure you shouldn't have a , in that and not a . :P. If not that's the most impressive memory usage I've ever seen for anything running on a computer. Especially given windows allocates 1MB just for the stack by default :P
Logged

thestig

Re: .png or .bmp background loading from externa...
« Reply #12 on: March 18, 2012, 12:54:40 am »
Quote
and about memory usage, its at 28.612 kb memory usage after 15 minutes of playing. Thats not bad I think.
Are you sure you shouldn't have a , in that and not a . :P. If not that's the most impressive memory usage I've ever seen for anything running on a computer. Especially given windows allocates 1MB just for the stack by default :P
That's what I was about to say... lmfao. Didn't I clearly note earlier in this topic that GameMaker's loader loads up the GMK, too? So you would have to account for that being loaded ontop of the initial 1MB allocation. And then you have to account for the loader itself as I'm sure it needs stuff in RAM too. But yeah, you would have to be using some insane black magic for 28KB!!
Logged
Re: .png or .bmp background loading from externa...
« Reply #13 on: March 18, 2012, 09:57:09 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 262
I'm dutch, we write our numbers in a different way. for us thats not 28 kb, but 28 mb.
Logged
Re: .png or .bmp background loading from externa...
« Reply #14 on: March 18, 2012, 02:01:38 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
Which is really only serving to prove our point - your engine is inefficient, and is going to be a nightmare to maintain. And yes, you will end up needing to change something in your maps at some point. How much time have you actually put into playing through the maps? And more importantly, how much time have you spent playing the dungeons, ensuring that the puzzles work the way you want and that the game is actually entertaining? Because I promise that you are going to find something that you need to tweak, something that either isn't as fun as it originally sounded or doesn't work as well as it should, or even something new that you can add to make it more entertaining.

And god speed when you decide that you want to change something, because you're going to have a hell of a time maintaining this project thanks to poor design decisions. But at this point, it seems more that you're arguing for the sake of saving face, and somewhat obvious that you aren't going to change. I hope when the time comes that you realize the large amount of work facing you when you want to change something, you'll at least realize what you were doing wrong so that it can be fixed in future projects.
« Last Edit: March 18, 2012, 02:05:26 pm by Minalien »
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: .png or .bmp background loading from externa...
« Reply #15 on: March 18, 2012, 03:11:23 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 262
Your always fast to judge, but you havent even seen the design of the game, the maps or anything else. Ever considered that I actually know what I still have to do and what has been done already and you dont? Why are you so certain that I'm going to change things when I say that it isnt going to happen? The maps have been checked over and over again.

And about if it is entertaining or not, everyone will see that in a different way. That what is entertaining to me can be boring for someone else. So the only important question is, do I enjoy creating it. The awnser to that is yes.

Edit: this topic is locked as I've already spend more time arguing about this then I should.
Logged
.png or .bmp background loading from external so...
« Reply #16 on: March 18, 2012, 04:37:24 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
Because I feel this is an important subject for newer developers to understand, I am continuing this discussion here in light of its OP-initiated lock. To get an understanding of the topic so far, consult the original thread: http://zfgc.com/forum/index.php?topic=38933.0. In summary, this is a discussion regarding the reason to use a system of tile maps to develop rooms in a two-dimensional game such as Legend of Zelda, rather than the highly inefficient method of storing the graphical data for each "room" as a separate image file on disk.

Quote
Your always fast to judge, but you havent even seen the design of the game, the maps or anything else. Ever considered that I actually know what I still have to do and what has been done already and you dont? Why are you so certain that I'm going to change things when I say that it isnt going to happen? The maps have been checked over and over again.
Even the most "infallible" game design will go through many changes throughout its development. Video games, much like any entertainment medium, are not fleshed out from start to end and developed with absolutely no changes. Just as a director of a movie will make changes on the fly to improve the experience for the viewers, a video game developer must be ready to change his design. No matter how detailed and expansive your design documents, you will run into things that you either want or need to change in order to improve the experience for the user. If professional development studios make vast changes to their AAA titles during play-testing in order to improve the feel of the game, or even to add a new idea in light of an unexpected spark of inspiration, I can assure you that any independent, student, or hobby developer will do so as well.

Quote
And about if it is entertaining or not, everyone will see that in a different way. That what is entertaining to me can be boring for someone else. So the only important question is, do I enjoy creating it. The awnser to that is yes.
This portion is in direct response to the OP: You misunderstand my meaning. I'm not saying that you or players will find any aspects to be unentertaining, I'm saying that you will run into periods where you find something that you can change, add, or remove in order to make it more fun. This can be in the form of either an interesting idea, or even a mechanical change that you feel is necessary - the point is that you need to be ready to make changes.
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: .png or .bmp background loading from externa...
« Reply #17 on: March 18, 2012, 05:01:34 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
I merged the two topics, but as the Atomic desires this topic is kept locked. Min I send you a PM.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.201 seconds with 73 queries.

anything