Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 8 9 [10]

Author Topic: Aqizzar makes a game  (Read 15443 times)

Aqizzar

  • Bay Watcher
  • There is no 'U'.
    • View Profile
Re: Aqizzar makes a game
« Reply #135 on: March 25, 2014, 10:06:52 pm »

You really need to read this. It's an incredibly popular article that many many game devs read at some point in their career. I know I read it! There's nothing fundamentally different between a console/grid-based game than with any other type of non-discreet positioning system. (The "console" nature just affects where you render things, i.e. at the closest position that can be displayed.)

The console rendering is only half the issue, taking user input is the other half.  Without a console, how do you read keypresses?  That's the kind of "lern 2 code" stuff that no tutorial ever seems to actually cover and I'm too proud to bother asking.

What about my post? D:

I'll have to decipher the language first, but I'll give it a look.  Looks like almost exactly what I did, and I'm pretty sure most of my issues are from quick implementation.  The "SDL_Event" in DoInput looks the most important, since it's not a console function.

I still have no clue why everyone considers this "gamestate" concept to be so important.  No no, don't try to explain it to me, I didn't get it the first time and I'd rather just make shit up myself.
Logged
And here is where my beef pops up like a looming awkward boner.
Please amplify your relaxed states.
Quote from: PTTG??
The ancients built these quote pyramids to forever store vast quantities of rage.

Kyzrati

  • Bay Watcher
    • View Profile
    • Grid Sage Games
Re: Aqizzar makes a game
« Reply #136 on: March 25, 2014, 10:17:32 pm »

If input is the only area where you're having the trouble then, yes, SDL_Event is definitely where you need to focus your effort. Input is provided to the program via an event queue, so each loop you just check that queue and react to whatever input it contains.

To expand upon what you see in that link:

Code: [Select]
while( game_is_running ) {
        check_input_queue(); // has the game react to any user input
                             // more specifically, changes the game state based on input
        update_game(); // update physics/logic/AI
        display_game(); // draw stuff to console
}
Logged
Cogmind - Sci-fi Roguelike (devblog) | X@COM - The X-COM RL | REXPaint - ASCII art editor | Patreon

Aqizzar

  • Bay Watcher
  • There is no 'U'.
    • View Profile
Re: Aqizzar makes a game
« Reply #137 on: March 25, 2014, 10:36:55 pm »

If input is the only area where you're having the trouble then, yes, SDL_Event is definitely where you need to focus your effort. Input is provided to the program via an event queue, so each loop you just check that queue and react to whatever input it contains.

Let me get back to you on that when I find the C# language to do so.  Apparently it involves invoking another C++ oriented third-party library with spotty documentation, incomplete user-submitted tutorials, and a support forum that hasn't been touched in years.

Maybe it's time I gave XNA the benefit of the doubt.  I never managed to swallow enough of my pride to actually plow through the instructions, because when it comes to teaching coding there is a giant gulf of difference between telling and showing that very few people who have the knowledge to do so ever seem to grasp.
Logged
And here is where my beef pops up like a looming awkward boner.
Please amplify your relaxed states.
Quote from: PTTG??
The ancients built these quote pyramids to forever store vast quantities of rage.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Aqizzar makes a game
« Reply #138 on: March 25, 2014, 10:55:36 pm »

I thought SDL was a C library...

As for gamestate, it's just a quick and clean way to handle menus, for me. It's so logical :v

I never used gamestates for what they are supposedly used for yet :P

Edit: as for input w/o a console, the GUI window itself registers keypresses and puts them in an event queue which is read whenever you please.
« Last Edit: March 25, 2014, 11:01:13 pm by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Aqizzar

  • Bay Watcher
  • There is no 'U'.
    • View Profile
Re: Aqizzar makes a game
« Reply #139 on: March 25, 2014, 11:06:10 pm »

As for gamestate, it's just a quick and clean way to handle menus, for me. It's so logical :v

I never used gamestates for what they are supposedly used for yet :P

I kinda thought that's all it's supposed to mean.  I mean, I've got a couple global strings to control what functions are called, which I guess is exactly what you're supposed to do?
Logged
And here is where my beef pops up like a looming awkward boner.
Please amplify your relaxed states.
Quote from: PTTG??
The ancients built these quote pyramids to forever store vast quantities of rage.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Aqizzar makes a game
« Reply #140 on: March 26, 2014, 12:42:49 am »

That also is a state machine, assuming you look at the string, do whatever, then decide which string to change it to. Good for simple AI, too.

I use a state stack machine, which literally stacks states on other states. It's pretty logical, All input goes to the state on the top of the stack, and it can pop itself (so input goes to the state under it) or push another state onto the stack.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: Aqizzar makes a game
« Reply #141 on: March 26, 2014, 12:44:31 am »

What about my post? D:
It's some sort of Elvish. I can't read it.
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

Kyzrati

  • Bay Watcher
    • View Profile
    • Grid Sage Games
Re: Aqizzar makes a game
« Reply #142 on: March 26, 2014, 12:49:36 am »

Serious suggestion: Use GameMaker. Spelunky was made with it. It can work fine for serious games, assuming you decide that your goal is to make a game. If you want to continue dabbling in pure programming then sure, why not try XNA. There seem to be tutorials out there that meet your needs.
Logged
Cogmind - Sci-fi Roguelike (devblog) | X@COM - The X-COM RL | REXPaint - ASCII art editor | Patreon
Pages: 1 ... 8 9 [10]