Scrolling Game Development Kit Forum
SGDK Version 2 => Help, Errors, FAQ => Topic started by: TheLaw on 2008-11-18, 03:19:33 AM
-
Here's a newbie question for ya. I'm considering making a RPG style game with SGDK 2 but I'll need a pretty strong in game GUI for all my inventory menus and such. I've been poking around a bit and I can't seem to find a premade one. I googled "SGDK GUI" and found a result mentioning xWidgets and SGDK, but I don't see anything I want at that site. I'd consider writing my own, but I see SGDK is in another beta now and is being converted to opengl - so now is probably not the best time for that. So, I thought I'd ask to see if there is a GUI out there that I haven't found, or is there a GUI system planned in the not too distant future? Also, just to get me going for now, is there a reasonably easy way to use windows native GUI controls?
So long and thanks for all the fish! (Sorry I just watched that move it's stuck in my head now)
Lawrence
-
I don't know how difficult it would be to use the proper windows mouse in your game, but it's very easy to make a cursor shaped sprite controlled by the mouse.
as far as I know if you create something with SGDK2.0, then bring it in to SGDK2.1 when it comes out, you will only have to change a few instances of "DirectX" with "OpenGL" but I'd wait for someone who knows more about that to confirm first.
-
Just because 2.1 is in beta doesn't mean you can't use it. Please, use it! It's ready to use, and the only reason it's beta is to let people know that it's the first release of a big update and hasn't been heavily used and tested by users yet. So there will likely be fixes before I release something official (non-beta). But there should not be significant design changes. If you have a project created with the beta, you should be able to continue working with it in the final release of 2.1.
As for a GUI, if you're going to run the game in windowed mode, the GUI could be accomplished quite simply by using Windows Forms developed normally with .NET controls, as demonstrated by the player options dialog box. You can see the code for this among the other code in the Source Code portion of the project tree. Is that an option for you, or do you want to run full-screen?
-
Hey thanks for the speedy replies guys. Yeah I did try out the 2.1 beta. The only thing stopping me from using it right now is that wonderful weather effects import uses directx and of course will not compile. Now I'm wondering if what Jam0864 mentioned is true. Can you just change instances of directx to opengl?
Yes I really wanna go fullscreen, but I gave up hope because my monitor says "signal out of range" when I try to use it - which is weird 'cause 16 and 24 bpp screens normally work fine... Perhaps opengl will fix this. It would be nice to include crazy eddies gui in the project somehow. Apparently he's got a c# version that I've been eyeballing: http://sourceforge.net/projects/ceguisharp
Even if I get stuck in windowed mode, I'd still like to have a pretty GUI like eddies. I'm not keen on hacking up something on my own, so if anyone is already working something they plan on sharing, I'd love to know about it. And I'd like to hear the developers thoughts on bringing in Crazy Eddies GUI(or other (GLGooey?)), 'cause I believe it's worth doing.
Thanks again,
Lawrence
-
The weather effects template doesn't really use DirectX features outside of what SGDK v2.0 used. It's basically just directly drawing its own layer on top of everything using the same (or similar) code that SGDK used to draw the "real" layers.
I'm not 100% on this, but I'm fairly certain it would not be a difficult task to update the weather effect to work with OpenGL. It should just be a matter of simply re-copying the code SGDK2.1 uses now to draw layers into the correct places.
Specific knowledge of OpenGL or DirectX shouldn't be required, although of course, you do kind of have to know what you're doing in a general sense. I know nothing about either OpenGL or DirectX, but I managed to make the weather template in the first place!
-
Hummn. Well, the compilers complaints where about directx, but I see what you mean now. Probably as I get my head around this SDK, I'll finger it all out. There's quite a bit going on under the hood. Thanks for the response, durnurd, and thanks for the great template. I wouldn't be to upset if you converted it for us... ;)
-
I sure would like to try, but unfortunately, I've since moved to Ubuntu, am unable to reinstall Windows in a second partition, and the portion of the DataSet class in the current version of Mono that parses XML schemas is apparently incompatible with the C# 2.0 version, which yields errors when loading .sgdk files. That's only the first of the errors; Since I can't get past that, I don't know what other kinds of inconsistencies there might be.
Hmm... maybe I'll try installing Windows again.
-
I knew it! I've been real close to trying a Ubuntu/Windows dual boot. Lots of folks say it's easy as pie, but I had visions of frustration. This is really getting off topic, but my Windows is running like crap now so I was gonna reformat and try the dualboot thing this weekend. Think I'll save the aggro and just install windows. Thanks for saving my weekend...! :-\
-
Back on topic.... Is an in game GUI a possability? I don't mean to pry, but if it's on the todo list, I'd be inclined to wait for it :yes:. Otherwise I may have to start hackn' my own :ugly:. My major project I wanna write will need every fiber of muscle this kit has, which means I'll be taking my time and writting smaller projects to learn from. So I'm not in a big rush for it.
-
linux+windows dual boot is easy provided you install windows first. If you install linux first, I'm not sure how to do it. I'm sure google has the answer somewhere.
But pretty much, after a windows install, make a new partition, install linux to it and your done!
The hard part is getting apps you need to use working on linux.
-
Back on topic.... Is an in game GUI a possability? I don't mean to pry, but if it's on the todo list, I'd be inclined to wait for it :yes:. Otherwise I may have to start hackn' my own :ugly:. My major project I wanna write will need every fiber of muscle this kit has, which means I'll be taking my time and writting smaller projects to learn from. So I'm not in a big rush for it.
There are no plans to create an in game GUI, although there are rule functions to track the mouse and make a sprite show at the location of the mouse cursor, which is a start. And I believe there are rule functions to detect the state of the mouse buttons, and all the keyboard keys. Those basics should be enough to get started on creating one. I'm not sure if you'd be better of using those somehow, or bypassing them to use other events directly from the window/display object. If you get stuck I can try and help you out or give you tips, though. If the final result is clean enough, it could be included as a core component of SGDK 2.2 or as a custom object that a user could import.
-
Well, I gotta say, I just installed Windows (finally! And it worked this time!) and now all I have to do is boot off my Ubuntu CD to reinitialize the GRUB bootloader to be able to boot into both.
On topic: Now that I have Windows and .NET 2.0 and SGDK2 installed, I should be able to work on SGDK2 things much more quickly now, like the Weather template.
-
Status Update: I have rain somewhat working in SGDK 2.1. Currently, only a weight of 1 works correctly. When I get back home, I will finish scaling, and update the others to work as well. Woohoo!
-
Well, bluemonkmn, I'm a ways off from writting a GUI, but I'm pretty sure I want to. To me - to do it right, I'd like to look into including Crazy Eddies GUI with your source code. Is there an area of your code that might accomodate such a beast? There's a c# version that uses opengl, so that's a start.
-
Hey, durnurd, how's the conversion going. Is it as easy as we thought?
-
Still at work right now. Gonna leave in ~15 minutes, and then we shall see. Having gotten the rain partially working, I think it will be a simple process to finish everything up.
-
The weather effects are partially updated. The attached file has the rain and fire rain effects implemented. Due to the way textures are implemented in SGDK2.1, I had to move the images out of the binary data and into graphic sheets. This mean that I can't generate or alter textures on the fly, which means I can't implement the snow effect using the dynamic snowflakes I had before. The fade to black effect could probably be implemented easily enough, but I didn't bother. Yet, anyway.
-
Hey, while your at it durnurd, could you allow the screen to not darken so much while it's raining. I didn't see a way to control the darkness (haven't looked at the new one yet...). Also, I wouldn't kibosh the snow effect - it's too good. If you had a sprite sheet with the various flakes on it, could you pull it off? I'd be happy to put one together for you based of the original web site's flakes, if it would help save the snow effect. I'd collect about 20 or 30 good looking flakes and you could choose at random. However, not being able to generate or alter textures on the fly is gonna cramp my style a bit. I'd rather see such functionality put back into the code. :(
Here's a stab in the dark, but if you get your fade back up, perhaps you could add lightning to the rain effect by zapping the background layer to white and back every once and a while at random. I suppose it could be a routine called Flash(), that users could add as part of a layers plan. Just putting it out there...
-
When I say that I can't generate textures on the fly, that's not entirely accurate. It's possible, but it would mean changing built-in code is the Display class, which would not make this plug-in a separate, single object, which could be imported no matter what you've already changed with the built-in code. A suggestion to BlueMonk: Add a TextureRef subclass that can generate textures directly from bitmaps instead of from names of built-in images.
It's certainly possible to get snowflakes in a graphic sheet and just choose from those. Mostly, the reason I implemented the snow at all in the first place was to show off how cool things can get when you really get into it, generating content from the internet on the fly. Which reminds me that I still have the project to get new content (i.e. maps) from the internet somewhere around here.
-
Well, bluemonkmn, I'm a ways off from writting a GUI, but I'm pretty sure I want to. To me - to do it right, I'd like to look into including Crazy Eddies GUI with your source code. Is there an area of your code that might accomodate such a beast? There's a c# version that uses opengl, so that's a start.
The Display class implemented in Display.cs is available both in the generated project and the SGDK2 IDE, and can be customized for individual projects. That's where all of SGDK2's access to OpenGL takes place (via OpenTK, the .NET OpenGL wrapper SGDK2 uses).
-
Attached is the version with all four weather types implemented in OpenGL. The snow I changed to use simple white dots for the snowflakes, which then takes up much less size. The rain effect also now has lightning, which by default is flashed randomly, but can be turned off. It also has a function called FlashLightning to make a manual lightning flash.
-
Should I somehow make a category/property for OpenGL-based projects on the SGDK2 projects site, so you can post it there, but keep the old one too? I haven't played with Joomla, much, so I'm not sure what options are available.
-
Should I somehow make a category/property for OpenGL-based projects on the SGDK2 projects site, so you can post it there, but keep the old one too? I haven't played with Joomla, much, so I'm not sure what options are available.
create a section dedicated for 2.1?
-
Perhaps a folder in the source code directory for each version. That's really the only place that would warrant different templates for different SGDK2 versions.
-
Great, now if I could only remember my password. Every time I go to that site I forget it because I only visit it like once every 3 months.
I'm not sure what you mean by the "source code directory". There's a "Code" folder under Templates, but that's not where the current weather template even resides. And there would probably also need to be separate folders under projects and samples, right?
-
By "source code directory" I do mean "code", yes. I don't remember quite why it's not in the code folder. I think it might be because it fits into both the code and graphics categories.
I don't know about the samples and projects directories. Those things have the full source code already in it, so either version would work, right? Or something?
-
I don't think SGDK 2.1 can compile and run SGDK 2.0 DirectX projects. I'm pretty sure I broke something there by removing all the hard-coded DirectX references from SGDK 2.1. So I probably need a whole separate tree, or an attribute of each file that can indicate what version it's for.