Bay 12 Games Forum

Please login or register.

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

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

Aqizzar

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

Your funeral.  I almost feel like I shouldn't even put it here, because this is definitely not a public release thing I want people to look at, this is a transition between Console drawing and Libtcod drawing that nobody who doesn't understand Libtcod C# (as if I do) should be bothering with.  There's probably stuff I still haven't done, but I won't really be able to look at it again until tomorrow afternoon, so I might as well offer it.
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 #1186 on: February 02, 2012, 11:00:12 pm »

Eh, if you are that ashamed you can take it down, I have my copy.
Anyway, I think you underestimate just how much tea I can drink when required.

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 #1187 on: February 02, 2012, 11:09:42 pm »

is there a way to do gamestates without classes?
I had it set up with a series of loops, but whenever going to a previous class the font doesn't show up, but all of the graphics and everything else works.
like, when you start the menu works perfectly, then when you go to the game it works perfectly, but when you go back to the menu the font won't show up, then when you go back to the game from the menu the 2nd time the font in the game doesn't show up.
I don't know as much c++ as I should for attempting to make a game,  I've recently started up my basic c++ studies again. (today learned about scopes, the scope resolution operator, static variables, and overloading functions)  classes don't start for another 200 pages o_O


but maybe it's just a problem I'm having with SDL,
« Last Edit: February 02, 2012, 11:15:28 pm by Valid_Dark »
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 #1188 on: February 02, 2012, 11:10:08 pm »

Eh, if you are that ashamed you can take it down, I have my copy.
Anyway, I think you underestimate just how much tea I can drink when required.

Ok, so I'm going to give a general description of what I am doing here, so if I fix this, you know not only what I did, but how.

Firstly, running the program.
Whoa, You are right! Thing is very unresponsive, however not entirely. With a little bit of effort, I can get the window to glitch across the screen. What we are looking at is most likely an infinite loop eating all the processing power allocated to the program, and never finishing the frame. From the fact that it apparently happens while you are drawing the level, I'm going to guess that during your loop to go over each tile, you forgot a counter++ somewhere.

Will edit post with an update if I find anything, stay tuned!

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1189 on: February 02, 2012, 11:15:18 pm »

is there a way to do gamestates without classes?
I had it set up with a series of loops, but whenever going to a previous class the font doesn't show up, but all of the graphics and everything else works.
like, when you start the menu works perfectly, then when you go to the game it works perfectly, but when you go back to the menu the font won't show up, then when you go back to the game from the menu the 2nd time the font in the game doesn't show up.
I don't know as much c++ as I should for attempting to make a game,  I've recently started up my basic c++ studies again. (today learned about scopes, the scope resolution operator, static variables, and overloading functions)  classes don't start for another 200 pages o_O

Sounds like I need to post more C++ tutorials. They'll come after I finish being busy with real-life things and trying to run Hellcannon.

Gatleos

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

Well, V_D, it sounds like the program is screwing with the pointer to the SDL_Surface when you switch states. Do the menu and game state use separate fonts?
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

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 #1191 on: February 02, 2012, 11:22:57 pm »

I only do my c++ learning from my book,
it takes a long time, but it's the only way I can assure a proper and thorough education of c++.
1600 pages and covers most if not all of the standard library.  on page 380 and have already made a game, so it must  be doing something right, right?  (and yes, I know I shouldn't have tried to make a game yet, it's just my book got to a boring part and I got bored so started learning sdl)

the menu has 2 ttf_fonts that are the same font, just different sizes,
and the game has 4 ttf_fonts that are all the same font (but a different font from the menu font) different sizes.

and Gatleos, I sent you the source code like a week ago asking for help with this very same problem and you never replied.
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.

Vector

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1192 on: February 02, 2012, 11:51:20 pm »

... Does anyone know of any sort of command that can slow down how fast the print operation works?  Like... "wait .5 seconds," or something like that?  This is driving me nuts.
Logged
"The question of the usefulness of poetry arises only in periods of its decline, while in periods of its flowering, no one doubts its total uselessness." - Boris Pasternak

nonbinary/genderfluid/genderqueer renegade mathematician and mafia subforum limpet. please avoid quoting me.

pronouns: prefer neutral ones, others are fine. height: 5'3".

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1193 on: February 02, 2012, 11:53:55 pm »

Python? From what I recall, it uses
Code: [Select]
time.sleep(x) This causes the code to wait for the given time. I'm somewhat sure x is in seconds. If not it should be milliseconds.

nenjin

  • Bay Watcher
  • Inscrubtable Exhortations of the Soul
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1194 on: February 02, 2012, 11:55:07 pm »

So all this talk of SDL got me reading, and I found what looks like a really good set of tutorials on SDL, graphics implementation, ect...

http://lazyfoo.net/SDL_tutorials/

What's people's opinions of SDL? It sounds like a higher level version of what libctod is about, handling input, graphics, events, ect. Thoughts?
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 #1195 on: February 02, 2012, 11:59:56 pm »

Not exactly... But sort of, yea.
Libtcod is all about roguelikes. As such, although it handles graphics and input, it does it in a way designed specifically for roguelikes. It also provides other cool functions like random number generators and noise generators.
SDL is for some basic boiler plate code that is very reusable that relates to input like keyboard an mouse, output like graphics and music, and other cool shit. It is to be used for anything you can use it for.

Vector

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1196 on: February 03, 2012, 12:04:02 am »

Okay, thanks.  I really appreciate it.

There's no way I can turn in this coding project with the desired modifications, though... I'm just going to have to mod them the hell in, erase/comment out craploads of extra code that doesn't fit with the new stuff so that the program doesn't have to go through a billion pointless checks, and take it in to office hours or something to show off.

*siiiiigh*

Yeah, like that's going to happen, and like they're going to want to goof around with my crummy stuff =(  Well, maybe if I finished by Monday, they'd still be interested... doubt it, though.


EDIT:

Actually, I have an idea.  A basic, horrible, and generally strange idea, but an idea.  An idea so generally bizarre that I don't really know why I'd ever do this thing, but if I work on it pretty hard through the next week, I'll have a respectable setup by at least next weekend, and ... well, I should go write up a game design doc.

Is it considered cheating to use a basic library for stuff like drawing windows, by the way?  As a math student, I feel enormously... underhanded using less rudimentary stuff without knowing how it works.
« Last Edit: February 03, 2012, 12:11:39 am by Vector »
Logged
"The question of the usefulness of poetry arises only in periods of its decline, while in periods of its flowering, no one doubts its total uselessness." - Boris Pasternak

nonbinary/genderfluid/genderqueer renegade mathematician and mafia subforum limpet. please avoid quoting me.

pronouns: prefer neutral ones, others are fine. height: 5'3".

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1197 on: February 03, 2012, 12:07:06 am »

Still rolln with pigs?
How much functionality can you possibly be giving this game?

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: if self.isCoder(): post() #Programming Thread
« Reply #1198 on: February 03, 2012, 12:09:31 am »

and Gatleos, I sent you the source code like a week ago asking for help with this very same problem and you never replied.
If your code hasn't changed much since you sent it to me, then: you're loading and unloading the fonts every single time the game loops. Move those function calls outside the while(gamerun) loop. Move all those SDL_surface loading functions outside the loop while you're at it, that's probably eating up quite a bit of CPU. That will probably fix the font disappearing problem as well.
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

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 #1199 on: February 03, 2012, 12:14:03 am »

kk, and ya my code had changed a great deal since then, but that area hasn't been touched.  thanks for the advice.  I'll tackle my code head on tomorrow and do a major renovation.
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.
Pages: 1 ... 78 79 [80] 81 82 ... 796