Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 77 78 [79] 80 81 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 886273 times)

nenjin

  • Bay Watcher
  • Inscrubtable Exhortations of the Soul
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1170 on: February 02, 2012, 09:29:25 pm »

Ok, that was what was screwing me up. Well, that and the implicit assignment of the reference.
Logged
Cautivo del Milagro seamos, Penitente.
Quote from: Viktor Frankl
When we are no longer able to change a situation, we are challenged to change ourselves.
Quote from: Sindain
Its kinda silly to complain that a friendly NPC isn't a well designed boss fight.
Quote from: Eric Blank
How will I cheese now assholes?
Quote from: MrRoboto75
Always spaghetti, never forghetti

Sirus

  • Bay Watcher
  • Resident trucker/goddess/ex-president.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1171 on: February 02, 2012, 09:34:14 pm »

Is it possible to make games in C, or should I wait to learn C++ for that? Would either of them work?
Logged
Quote from: Max White
And lo! Sirus did drive his mighty party truck unto Vegas, and it was good.

Star Wars: Age of Rebellion OOC Thread

Shadow of the Demon Lord - OOC Thread - IC Thread

nenjin

  • Bay Watcher
  • Inscrubtable Exhortations of the Soul
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1172 on: February 02, 2012, 09:40:37 pm »

You can make games in C, sure. But a lot of the useful libraries and resources that are out there are targeted at C++.

You could easily make a fairly complicated ASCII or text adventure game entirely in C. If you want it newer and shinier and fancier than mid 80s DOS games though....might want to hold off for C++. There's no reason you can't start working through game logic with what you know of C, now, though.
Logged
Cautivo del Milagro seamos, Penitente.
Quote from: Viktor Frankl
When we are no longer able to change a situation, we are challenged to change ourselves.
Quote from: Sindain
Its kinda silly to complain that a friendly NPC isn't a well designed boss fight.
Quote from: Eric Blank
How will I cheese now assholes?
Quote from: MrRoboto75
Always spaghetti, never forghetti

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1173 on: February 02, 2012, 09:43:46 pm »

There is an implementation of libtcod for c.
Could make a pretty good game if you were very patient and carefully.

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1174 on: February 02, 2012, 10:06:57 pm »

Ok, so I have uploaded a sample game. It shows pretty well how to handle game states, so that there isn't any of this mess that Magma seems to think I would end up with, and it draws pretty well, solving the problems of when to flush and such.
Also, heads up, making this totally open source and free to download and what ever, so you can't get arrested for downloading pirate software.  :P
Link!

Be warned, the keyboad input is annoying. Give me a break, I built it in less than an hour using libtcod.

Sirus

  • Bay Watcher
  • Resident trucker/goddess/ex-president.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1175 on: February 02, 2012, 10:13:51 pm »

Looks interesting, if a little advanced for my level. I didn't see any magma though.
Logged
Quote from: Max White
And lo! Sirus did drive his mighty party truck unto Vegas, and it was good.

Star Wars: Age of Rebellion OOC Thread

Shadow of the Demon Lord - OOC Thread - IC Thread

Aqizzar

  • Bay Watcher
  • There is no 'U'.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1176 on: February 02, 2012, 10:14:36 pm »

Be warned, the keyboad input is annoying. Give me a break, I built it in less than an hour using libtcod.

You're already doing better than I did.  I'm most of the way through converting my drawing logic to TCODConsole commands, because I am stubborn.

The first time I hit compile (and fixed all the errors), I actually leaned back away from the monitor.

Doesn't work anyway.  I don't know why yet.  I'm going to convert every instance of Console in the rest of the program to my proprietary WriteAt/This commands, then start throwing in flushes until it draws something.  This is probably a really bad idea.
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.

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1177 on: February 02, 2012, 10:17:54 pm »

Hmm, I don't think it will break anything too much... Might mess up your FPS count though, so don't depend on that.
Libtcod assumes that you are flushing once per cycle, so bases your FPS off that.

Aqizzar

  • Bay Watcher
  • There is no 'U'.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1178 on: February 02, 2012, 10:23:39 pm »

Libtcod assumes that you are flushing once per cycle, so bases your FPS off that.

I don't understand what that means.  I do know that it didn't draw anything when I had flushes all over the main program loop, only drawing anything when I put flushes in the WriteAt/This methods themselves.  And I can't move the window, or click anywhere without the window turning gray.

And I don't believe the included Terminal typeface is actually the same as Dwarf Fortress, because I used the DFWiki's character table to write my input interpreter and it's drawing different symbols.  Not that that really matters, I'm just throwing it out there.
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.

Valid_Dark

  • Bay Watcher
  • If you wont let me Dream, I wont let you sleep.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1179 on: February 02, 2012, 10:25:56 pm »

I wish there were different threads for the different languages.
Max what language is your example in? I'm on my phone so I can't download it right now, but I am still having an issue with gamestates with my sdl c++ game and want to know if I could benefit from this.
(sorry for sounding selfish)
Logged
There are 10 types of people in this world. Those that understand binary and those that don't


Quote
My milkshake brings all the criminals to justice.

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1180 on: February 02, 2012, 10:30:40 pm »

And I can't move the window, or click anywhere without the window turning gray.
I think I know that problem. Was a pain in the butt for me to find for the first time too. You need to tell it to take input somewhere, it it just ignores everything including the mouse.
Try adding
Code: [Select]
TCODConsole.checkForKeypress(); somewhere that you know your code will go over it, such as the start of the main loop.
Slowly procrastinating and building this new library in c# for this that will handle input significantly better, so hopefully that will be functional one day and we wont have to jump these loops.

I wish there were different threads for the different languages.
Max what language is your example in? I'm on my phone so I can't download it right now, but I am still having an issue with gamestates with my sdl c++ game and want to know if I could benefit from this.
(sorry for sounding selfish)
It is c#, but it might be helpful to you, as it shows how to set up your classes. Tell me, what problems are you having?

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: if self.isCoder(): post() #Programming Thread
« Reply #1181 on: February 02, 2012, 10:31:46 pm »

Meh, I really don't like the way libtcod handles input. I have it set up to use SDL's event system, which is much better. They run cleanly alongside each other with no problems.
Logged
Think of it like Sim City, except with rival mayors that seek to destroy your citizens by arming legions of homeless people and sending them to attack you.
Quote from: Moonshadow101
it would be funny to see babies spontaneously combust
Gat HQ (Sigtext)
++U+U++ // ,.,.@UUUUUUUU

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1182 on: February 02, 2012, 10:33:31 pm »

It is pretty crap as for as input goes. Not sure why they chose to do it how they did.

Aqizzar

  • Bay Watcher
  • There is no 'U'.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1183 on: February 02, 2012, 10:39:35 pm »

And I can't move the window, or click anywhere without the window turning gray.
I think I know that problem. Was a pain in the butt for me to find for the first time too. You need to tell it to take input somewhere, it it just ignores everything including the mouse.
Try adding
Code: [Select]
TCODConsole.checkForKeypress(); somewhere that you know your code will go over it, such as the start of the main loop.

Yeah, that didn't seem to help much.  Obviously, the smart thing to do is a new project and just try to copy over as much useful as possible, but I can't convince myself that that would be any easier or faster than just slogging onward and making this thing work as is.

I feel like an ass, but I don't suppose I could trouble you to take a look at it?  Not immediately, I'm going to keep trying to troubleshoot, plus convert all the Console stuff.  But it really seems like it's hitting a critical snag somewhere and just stops working.  It draws the hardcoded border and menu placeholder (and not correctly either), and but doesn't draw any of the map stuff like it's already supposed to do, nor does the Console draw any of the stuff that the Console is still supposed to be drawing.  It's like it gets as far as the DrawTileMap and gives up.
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.
Pages: 1 ... 77 78 [79] 80 81 ... 796