Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
voodoo dog
Jun 6, 2001

Gun Saliva

Danbo Daxter! posted:

I've been learning C++ for a while now hoping to get started writing meaningful games myself, and I think I have a good enough grasp of the language to start applying it. (I have some experience with Java, so I had a decent knowledge of OOP before I even looked at C++).

I am not interested in 3D games at all really, 2D is more my sort of thing. Are there any decent tutorials out there for using DirectX (or hell, OpenGL or some other graphics API) in a 2D context? Most of the ones I find seem to focus on 3D, and that seems like a gigantic branch of games development that I'ld rather not go near if I can help it.
I agree with Benji that you should definitely look at existing 2D graphics libraries and use those instead. SDL would be a pretty good choice (certainly better than using DirectDraw), but if you want a more complete package, I'd strongly recommend ClanLib. It has a lot of useful stuff (such as GUI, network, sound etc.), is easy to use and also quite a lot faster than SDL as it's using opengl to render stuff.

It's also written in C++ and not in C like SDL is, which I prefer. I've been using it on and off for a few years now and in my opinion it is really well done and also quite mature at this point. I've always been wondering why there don't seem to be many people using it, the only reason I can come up with is that some people like to do lower-level stuff themselves as well. It may look overwhelming at first, but the good thing is that it's very modular so you don't have to use it all at once.

Adbot
ADBOT LOVES YOU

voodoo dog
Jun 6, 2001

Gun Saliva

DBFT posted:

Thanks for that, that's the sort of thing I was looking for. If anyone else has anything to help me that would be great, this is the first time I've tried world generation

What I've been using in the past is the Diamond-Square-Algorithm, but it can be a bit difficult getting it to do what you want. Still, I guess it can't hurt to take a look at it.

voodoo dog
Jun 6, 2001

Gun Saliva

DBFT posted:

Should I be able to join the dots and see diamonds because I can't? I can't really see what is a diamond and what is a square?
What might be confusing you is that after the first step, there aren't really four diamonds, unless you imagine four points outside of the actual area. I hope this makes sense..

Also, here you can find an implementation of this algorithm in C#. I wrote it quite a while ago, and it really isn't very readable, but maybe it'll still help you. The code skips the first three steps and does them manually, though, I probably wouldn't do it that way again. Basically, I was just trying to make it generate maps that would always have negative values at the borders and positive ones in the middle.

I think I only used it to separate land from water, the way I did that was that I took an arbitrary value (like 0.0) as a starting point, calculated the water percentage and in several steps adjusted that value until it was close enough to the land percentage that I wanted.

Hope this helps a bit, good luck. :) (and if you want to, you could also contact me on aim).

voodoo dog
Jun 6, 2001

Gun Saliva
Well, since this is a question I've been dealing with again and again, I thought I might as well post here. Basically, I have a very hard time deciding what language to do my game programming in. C# is what I'm most comfortable with, so XNA would be the natural choice, but I'd like at least the possibility to run the game on Linux as well.

Basically, it comes down to the fact that it is hard finding a decent library that does all I need. Especially, I'd like a solid UI library etc., so I always think of the days when I was doing stuff in C++ and ClanLib offered all I needed. Graphics, Sound, GUI, networking etc., so I am always tempted to move back to that. However, C++ is more of a hassle, so stuff in general takes longer to write.

I have even tried writing a SWIG wrapper around ClanLib, but their signal/slot-stuff was pretty much impossible to wrap and I gave up.

With all other languages and game libraries, there seems to be a lot of library-hunting involved. I just haven't found a combination that works for me yet, maybe it is indeed time to try out a few more python options.

voodoo dog
Jun 6, 2001

Gun Saliva

nihilocrat posted:

Please explain, I was thinking of making a wrapper as well. Perhaps I can shed some light on it (and more likely, not).

Panda3D is a good example of ClanLib for 3D: it is a one-stop-shop of sorts for most of what you need. The documentation is pretty bad, though, and it reeks of "this library was made for people who were being trained how to use it", so a lot of very simple stuff is not quite so obvious because the 'proper' way of doing it is undocumented.
The first issue I had was with a crash when initializing, but that turned out to be because they called CoInitialize (for DirectInput) with the wrong threading-model (doesn't work inside the .NET framework) and was easy to fix.

I don't quite remember at what point I gave up, I know I was able to at least call a few simple functions. I haven't really done a lot with function pointers, so maybe that's why I didn't see a way to wrap the signals/slots code. In theory, all you have to do is to convert a managed function pointer to a "normal" one (I think the Marshalling-class has a method for this), but I could never get it to work somehow.

Writing about this, I really want to give it another try..

voodoo dog fucked around with this message at 21:12 on Nov 24, 2008

voodoo dog
Jun 6, 2001

Gun Saliva

nihilocrat posted:

Wait, are you talking about wrapping good old C++ ClanLib with good old CPython? I have also discovered Py++ in the interim. Python-Ogre uses it, so perhaps it actually works well. I think a ClanLib wrapper would be great for the Python game development world. We've already got a large number of graphics libraries, but nothing that is a one-stop-shop.

I hand-coded a ctypes wrapper around a C function that took function pointers a few years ago, and didn't have any issues. I was actually pretty amazed.

I am also sort of having trouble finding a good engine/set of libraries and I'm feeling like I might want to roll my own. Of course, whenever I decide I might want to do something big I have to throw in a bunch of other requirements or froofy features. My idea was to use Ogre3D on top of a sort of "game OS" written in Stackless Python, where every process or game entity gets its own tasklet, following the MVC model to have clear seperation between presentation, control, and data throughout the entire engine.
Oh, I was actually talking about wrapping it for C#/.NET.. ;-) Well, once you've got the SWIG code written, it should as far as I know also work with python, but that doesn't seem to be what you are talking about either.

EDIT: Just tested it with what I've got from last time, and it does indeed seem to be working in Python as well.

voodoo dog fucked around with this message at 21:56 on Nov 24, 2008

voodoo dog
Jun 6, 2001

Gun Saliva

Thug Bonnet posted:

You're going to have a hard time finding a single library that does it all and is completely cross platform. I don't know if I would recommend it but you could probably use C# for your Win32 gui code, use managed C++ for the core, and of course use something other than C# for the gui on other platforms. I think you'd be making life harder for yourself that way, though.

The other option is to mix and match your libs, say SDL (or whatever) for your video/input/sound, and something else (probably platform specific) for your gui lib. You could also write your own in SDL, too.
I know it is probably expecting a bit too much, I am just spoiled by my C++ experiences, I guess. I am currently playing around with Crazy Eddie's GUI combined with SdlDotNet, which seems to be working pretty well. Documentation could be better, but for the most part things are done almost exactly the same way as in the C++ variant.
Plus, if performance at some point turns out to be subpar, I can still switch from SdlDotNet to OpenGL at some point.

voodoo dog
Jun 6, 2001

Gun Saliva

hallik posted:

I just bought the $40 one. Hope this pans out. The CSS on that progress bar says 51% right now. We'll see if it moves.
Bought that, too, I've been dying to get my hands on some good modeling software. Seems to be at 65% now, so it's definitely moving.

voodoo dog
Jun 6, 2001

Gun Saliva

PDP-1 posted:

Does Messiah let you create a model or is it just a rigging/rendering tool?

The documentation on the website is pretty thin, and I kept getting directed to some pay-to-watch training videos.
After looking at some videos, it does seem to focus on animation a lot more than I originally thought. I mean, for $10 there's not much else I could have bought and it does have basic modeling capabilities, I guess I should have researched it better though.

voodoo dog
Jun 6, 2001

Gun Saliva

Drox posted:

How basic is basic? Does it do the job if you're just wanting to fart around with cheap technology and don't expect to be making the next Pixar feature film?

Doesn't sound like it.. Searched around a bit more on the net, and everyone is saying you do need some modeling software alongside it, even if it's just a $100 one.

Example of such talk:
http://www.quartertothree.com/game-talk/showthread.php?p=2561198

Adbot
ADBOT LOVES YOU

voodoo dog
Jun 6, 2001

Gun Saliva
If you want template-magic for your scripting integration, you could also use boost::python which works pretty well.

If you just want to do some simple scripting without worrying about external dependencies etc., you could also use AngelScript. From what I've experienced, it is extremely easy to use with very few weirdnesses. For more complex scenarios, you'd still be better off with lua or python, probably.

I haven't used either of those in a big project, but both seemed to work pretty well on a small scale.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply