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
HauntedRobot
Jun 22, 2002

an excellent mod
a simple map to my heart
now give me tilt shift
I've refrained from posting about it before as I have a tendency to start things and not finish them on a regular basis, but I've been designing a little puzzle game in the vein of Boulderdash on my coffee breaks, and have started coding.

I've tried this before but always the other way round (try and make an engine first, then work out what to do with it) - this way seems to be working better. As I'm hoping this will become part of some future showreel for getting a job in the games industry I was torn over whether to implement it in XNA (would've meant targeting Windows/XBox, learning C#) or try and go cross platform by doing it all myself, which in the end won out. I figured, it would be more interesting to code that way.

I'm using wxWidgets and OpenGL to make the framework which so far seems to be working great - this means I can target Windows and Linux as Linux could do with some native games. A bit of a headache getting OpenGL to play ball in a wxWidgets framework, but I found some tutorials that helped demistify it. My big problem with wxWidgets is it's a bit rough around the edges, and I'm kind of afraid to upgrade it... I'm a few versions back already, and I'd like to think I could just hit "update" or download a new version of wxPack but I'm scared of breaking my toolchain >:(

Adbot
ADBOT LOVES YOU

HauntedRobot
Jun 22, 2002

an excellent mod
a simple map to my heart
now give me tilt shift
Acquisition of a laptop has led to a resurgence of activity in my game, I can now pick it up and work on it in short bursts when I have an idea, code in Starbucks and whathaveyou.

As such the engine is progressing nicely, albeit in a slightly uncontrolled way. I read a lot of advice which said "be wary of making everything too general on your first game" which I realise I'd been doing, so I stopped. That said, I have what appears to be a neat layered OpenGL canvas solution which renders a bunch of layers in turn, and I can switch them around when I need to on the fly. Tile engine lives in one layer, menus and ui in other layers.

But I'm thinking of swapping out the tile engine for something a bit more 3d, going for the oldschool isometric perspective, or something equivalent. Maybe. I think I can get better puzzles going with the addition of a bit of 3d.

HauntedRobot
Jun 22, 2002

an excellent mod
a simple map to my heart
now give me tilt shift
Is there an easy way to render the contents of a block of memory to a texture in OpenGL as if it was a traditional framebuffer? This is for a different project, but I have a 256x192 block of memory where each byte is a palette indexed colour, which sadly I can't do anything with the structure of as it's out of my control.

HauntedRobot
Jun 22, 2002

an excellent mod
a simple map to my heart
now give me tilt shift
It's been a while since I replied to this thread, but I wanted to say thanks to the people who replied to my questions so far.

Work on my game engine continues. I spent a good deal of time learning about shaders, only to find my development laptop can't cope with them so I'm shelving any use of them until more of the game's done. A hell of a compromise, but there's no real need for me to use them for this game, and coding in Starbucks/on the beach is too much of a draw.

I've also inadvertently emulated a decent portion of javascript in getting my UI code up and running. Overkill, again, but something I can use a lot later down the line and being able to play around with UI elements in a simple XML file without having to do a load of recoding is well worth it.

HauntedRobot
Jun 22, 2002

an excellent mod
a simple map to my heart
now give me tilt shift
Sure someone will correct me if I'm wrong here, but I think the method of using high res timers has fallen out of favour bigtime since multi-core CPUs came along, which have problems with it, also CPUs that have dynamic speed throttling. You want to be using whatever API call it is that gives the number of milliseconds since some date... the equivalent of time.GetTime() or whatever.

HauntedRobot
Jun 22, 2002

an excellent mod
a simple map to my heart
now give me tilt shift

Hubis posted:

Computationally, the easiest thing would probably be to flatten the overlapping circle into a "D" shape, which I don't think should be too hard...

Instead of circles, render them as flat shaded spheres, then the areas where they intersect will be nicely delineated.

HauntedRobot
Jun 22, 2002

an excellent mod
a simple map to my heart
now give me tilt shift

The Cheshire Cat posted:

I have a basic openGL/C++ related question: I've downloaded a tutorial to get a basic 2D window running, but I'm wondering if there are any libraries out there that will simplify the process while also giving me control over various aspects of the window through predefined functions?


I'm guessing you went down a similar route I did, starting from online tutorials like NeHe's and then thinking "this is all very well and good, but it's not exactly clean code", right?

I haven't found anything that really does what you want - I went from there to using wxWidgets but that throws everything and the kitchen sink in as well so I then spent a bunch of time ripping that all out and starting again.

The thing is, there really *isn't* that much to doing what you sound like you want but it's not really well documented anywhere. Not that I'm trying to hold my own work up as any kind of a standard, but it didn't really click with me till I got really disciplined about creating my own little mini-API that had nothing specific about the game I was writing, but it wrapped all the Win32 window creation stuff, especially the stuff that lived outside of classes, and gave me a C++ "WinApp" object that I can subclass, and create from main.

Now when I want to make a game I can just make a "GameApp" class that subclasses WinApp and go

code:
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)  {
   appCmdLine =szCmdLine;
   gameApp=new GameApp (hInstance);
   gameApp->Init();   // window creation stuff
   gameApp->Run();    // mainloop
   gameApp->Exit();   // teardown and cleanup
   return 0;
   }
and all the grotty stuff is done for me. WinApp does the window creation, contains the Windows message pump, listens for messages and passes them to handlers etc etc. All the code I write from that point on is nice and arranged in classes, and I don't have to get my hands dirty with Win32 stuff ever again.

So if I have one tip, I guess it's that.

HauntedRobot
Jun 22, 2002

an excellent mod
a simple map to my heart
now give me tilt shift
My new years resolution was to go beyond my little OpenGL toy projects and build a game engine. Just did some very basic, "duh" optimisations, bringing my OpenGL code screaming into the early-to-mid-00s state of the art. And, well...

code:
           %   cumulative   self              self     total           
          time   seconds   seconds    calls  ms/call  ms/call  name 
Before:  29.98      2.59     2.59     1042      2.49    5.23  Layer_Game::Render(SceneGame*)
After:    1.28      0.83     0.02     1005     0.02     0.02  Layer_Game::Render(SceneGame*)

HauntedRobot
Jun 22, 2002

an excellent mod
a simple map to my heart
now give me tilt shift
I've finally decided to get into Unity, and I've been watching a ton of tutorials and I just want a bit of a sanity check here. I'm kind of blown away by what you can do with it, all the systems it gives you for basically free, it's very inspiring. But I look at the kinds of games I'm planning on making with it, stuff like roguelikes, 3d puzzles and whatnot and things with a lot of procedural generation and it looks as though I'm going to be generating a lot of my stuff from code, still. Rather than you know, pull an asset from the asset store, position it in a level, give it a rigidbody and throw physics at it, the whole "grab a bunch of premade stuff and combine it to make a game" model it seems to be funneling me towards.

Is that a crazy way to use Unity? Just as basically an event handling, render pipeline setup, ui overlaying front end on something that's very driven by hand-carved procedural generation code? Should I try harder to get into that mindset of leaning heavier on it or just go with what my instincts are telling me here, cos I'm very much a coder at heart, just not one that can be hosed to troubleshoot making an engine from scratch in TYOOL 2019.

Adbot
ADBOT LOVES YOU

HauntedRobot
Jun 22, 2002

an excellent mod
a simple map to my heart
now give me tilt shift
That's great advice, thanks everyone :) I still don't regret wasting the time I spent trying to write my own engine, it was good learning but I realised if I kept doing that I'd be tinkering forever and I want to actually release something one day, maybe.

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