Author Topic: SubLists for Graphics and Framesets  (Read 10779 times)

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
SubLists for Graphics and Framesets
« on: 2012-10-19, 01:08:58 AM »
Would it be a burden to ask:

If SGDK2 could feature sublists for managing Graphics and Framesets? Instead of all Graphics and Framesets falling under "Graphic Sheets" and "Framesets"?

That way I could create a category under Graphics Sheets called "Car Graphics"

Create all Graphic sheets of a certain type inside of it

And collapse/expand it whenever necessary without having to collapse the Graphics Sheets listing?

It helps things become organized when you have a a large amount of graphics.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2733
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: SubLists for Graphics and Framesets
« Reply #1 on: 2012-10-20, 06:34:55 AM »
I think Vincent had the same request because he had a lot of graphics in LoK Revival too. Vincent, did you find a good way to deal with this concern, or just push through the difficulty without any better answer?

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: SubLists for Graphics and Framesets
« Reply #2 on: 2012-10-21, 02:46:58 PM »
Since SGDK2 Projects use an XML Structure, wouldn't it just be creating new categories for graphics to fall under?

It might call for a new version of SGDK2 and perhaps a converter for old projects...

I'm in desperate need of this. There are too many graphics and framesets everywhere. Maybe even an extension for sprites so I can categorize those too in the directory.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2733
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: SubLists for Graphics and Framesets
« Reply #3 on: 2012-10-21, 05:10:42 PM »
Implementing the data structure is the easy part. Implementing all the management of categories and user interactions with folders would be the hard part. But what if it were simply implemented as an extension of the name? For example, if you include a "\" in the name, everything before the "\" would represent a folder into which the object would be nested. And perhaps multiple "\" characters could be used in the name to nest objects multiple levels. Would that be a useful implementation of this idea without even requiring any upgrade or data structure change? The nesting of an object could be changed with a simple rename.

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: SubLists for Graphics and Framesets
« Reply #4 on: 2012-10-21, 06:16:24 PM »
But when I expand the graphics sheets directory, all of the sheets would expand, regardless of how I named them.

I need a solution that would allow me to create folders under the GraphicsSheet and Frameset or Sprite folders.

This is more of an issue within the IDE. I need things to be organized within the IDE.

Sorry if I'm misunderstanding you.


bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2733
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: SubLists for Graphics and Framesets
« Reply #5 on: 2012-10-22, 05:24:15 AM »
No, I'm saying if I changed the code to interpret "\" as a folder name, then there could be real folders there instead of everything at the same level. Would that suffice?

Vincent

  • SGDK2 Addict
  • Expert
  • Fanatic
  • *****
  • Posts: 602
  • Legacy of Kain: Revival is completed!!!
    • View Profile
    • Chivalrous Games
    • Email
Re: SubLists for Graphics and Framesets
« Reply #6 on: 2012-10-22, 06:13:07 AM »
Hi guys, sorry if I'm late. Yeah, I remember I asked for something like this a while back but I didn't do anything about it finally.  I think a just tried to name my elements in a logical way with some meaningful letters or words at the beginning of each graphic sheet or frameset.  But I understand that I have a lot less graphic sheets and frameset in LoK:R than there is in #Sharp's project.

I think that making folders with a "\" prefix is a great idea! :)
Legacy of Kain: Revival completed!
http://lokrevival.webs.com

See also my company website:
http://chivalrousgames.com

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2733
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: SubLists for Graphics and Framesets
« Reply #7 on: 2012-10-22, 07:02:56 AM »
Thinking about this more, I'm starting to worry that you might hit some unexpected limit if you have so many graphics. Assume I make some estimates:

1. I expect the average graphic sheet to be about 160x160 pixels (25600 pixels or 102240 bytes)
2. I expect the largest number of graphics sheets that is manageable in a flat list is about 200.
3. 200 * 102240 = 20,480,000 bytes

Okay, most video cards these days have more than 20 MB of video memory, so were probably OK at these estimates. But how much over these numbers are you going? SGDK2 doesn't do much to manage memory if you have a lot of graphics. I don't know what happens if you try to use more graphics than your video memory will allow. Is it time to take a moment to do some math to see what limits you might be approaching?

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: SubLists for Graphics and Framesets
« Reply #8 on: 2012-10-22, 08:30:31 AM »
Don't tell me that SGDK2 loads every graphic into memory, even the ones that I'm NOT currently using...

I don't load many graphics in my game at any given time, BUT I DO have a large amount of graphics (113 I believe) and as a matter of fact, I believed that that was the reason why I kept reaching "OutOfMemory" Exceptions whenever building my project (UNTIL I removed a large amoung of large Mp3 and Wav files and some Large Maps)

That's the only limit I've ever reached. And ever since I've cleaned my game from 60MB to 30MB I haven't ran into the limit again.

It's well under 200 sheets but each sheet is well above 160 by 160 pixels.

But again, I don't load many graphics at one time and I properly dispose of graphics that I load myself (2048 x 2048 For skydome texturing, etc)

How will graphics that I'm not currently using affect video memory?

EDIT:

Ohey I ran into a System.OutOfMemoryException.

But I've noticed that it only happens if I have a few things loaded within the SGDK2 IDE, such as the Map editor, Sprite Editor, etc...

I'll have to close all of the windows in SGDK2 before I compile.
« Last Edit: 2012-10-22, 06:08:45 PM by #Sharp »

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2733
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: SubLists for Graphics and Framesets
« Reply #9 on: 2012-10-22, 06:58:25 PM »
At runtime, the game only loads into video memory the graphics that are referenced by the sprites and tiles on the current map. But I believe it leaves to the .NET garbage collector the decision on when to unload them (unless you explicitly unload them, as I guess you do with your sky). And regardless of whether the graphics are loaded into video memory , they are embedded in the EXE. So I'm not very familiar with Windows architecture, but it it loads the whole EXE into memory then it has all the graphics loaded as soon as the EXE starts, at least in compressed form. The same is true of the IDE since it keeps the data from the SGDK2 file in memory as you're working on your project.

But usually video memory is what you have to be concerned about. I would have to do a lot more investigating to see if there is a real risk. But if you can estimate how much memory your graphics take up in uncompressed format, it might make such investigation unnecessary.

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: SubLists for Graphics and Framesets
« Reply #10 on: 2012-10-22, 07:07:44 PM »
But it is possible to create an organized structure for objects such as Sprites, Graphic Sheets, and Frame Sets, right?

Video Memory shouldn't be much of an issue for me. I don't load many images and I explicitly manage the unloading of textures on Map Changes.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2733
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: SubLists for Graphics and Framesets
« Reply #11 on: 2012-10-23, 04:56:39 AM »
I will try implementing the ability to nest objects in folders by including "\" in names if you think that will be an adequate solution.

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: SubLists for Graphics and Framesets
« Reply #12 on: 2012-10-23, 10:31:16 AM »
Thank you bluemonkmn.  ;D I'll try and report any serious issues I have with limitations in SGDK2 from this point on.

The college I'm at right now has computers with more Ram, 64bit Windows Installations.

I might have to start developing on those (They're much faster by the way)
« Last Edit: 2012-10-23, 10:48:27 AM by #Sharp »

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2733
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: SubLists for Graphics and Framesets
« Reply #13 on: 2012-10-25, 03:52:21 AM »
OK, #Sharp, I think I have Framesets supporting folder names. Are Graphic Sheets the only other object you think needs to support folder names? Can you rank any other objects that you think should support folder names in order of the importance of this feature? When I get something ready I'd like to send it to you to test before releasing.

Edit: As I think about it more, I realize if I'm going to do this, I should make sure I get it right the first time. So here's a question: is it ideal to have the folder structure be part of the name, and require that the full path be used whenever referring to a frameset or graphic sheet (including in code), and allow the same name to be used so long as it is in different folders? Or is it better to make the path separate from the name, and show only the name everywhere else besides the project tree, and require that the name be globally unique independent of its folder path?
« Last Edit: 2012-10-25, 05:03:42 AM by bluemonkmn »

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: SubLists for Graphics and Framesets
« Reply #14 on: 2012-10-25, 02:04:06 PM »
The first option only being a minor setback as I'd have to include the directory name in all custom implementations of GetTextureRef()

That's the only bad thing I can honestly think of.

Keep them globally unique. *This is only my opinion*

Because it would keep things incredibly simple.

For my needs I only need a structure of organization that's mainly just visual; the ability to condense and expand subdirectories of game objects is all I really need.

(Plus it would be less work for you and I because you'd have to change all of the base objects and I would have to change all of the plans XD)

In Order (This is the final list I've settled on):

Graphic Sheets

FrameSets

Custom Code Objects

Sprite Definitions

Counters

Maps (Optional, I already categorize maps by adding an A and B to the beginning of their name, because I have 2 kinds of maps)

Thanks!
« Last Edit: 2012-10-25, 03:30:34 PM by #Sharp »