Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 16 17 [18] 19 20 ... 796

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

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #255 on: January 09, 2012, 11:55:48 am »

I can code drunk, that is fine, can't remember what I did the next day can be a bit of an issue, but otherwise no worried.

Fucking insomnia, don't even get me started. Like somebody took a mallet to your brain.

Darvi

  • Bay Watcher
  • <Cript> Darvi is my wifi.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #256 on: January 09, 2012, 11:56:26 am »

Insomnia. Drunkenness actually does wonders.
Logged

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #257 on: January 09, 2012, 11:57:06 am »

Yea but I'm already on the path from dwarven drunk to hobo drunk.
Best not to drink alone from here on in.

Shakerag

  • Bay Watcher
  • Just here for the schadenfreude.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #258 on: January 09, 2012, 11:58:28 am »

Yeah, I can imagine how that would be.  It doesn't sound too terrible, though.  What language are you working in again?

Mainframe assembler.  >_>

So what's your algorithm? I'm thinking of recursion.

Ehh, I'd like to avoid that if I can.  Mostly, so far, I'm scanning the target string a character at a time.  There's a ... "priming" search area, to handle filters without a leading wildcard.  Mismatch at that point returns a negative result.  Once I hit a wildcard, then I switch to a different algorithm.  A sentinal pointer sits at the character in the filter just past a wildcard, and a second pointer traverses the filter.  If I hit another wildcard, I skip it and bump up the sentinal pointer.  Mismatch returns the traversing pointer back to the sentinal pointer value, and a match bumps the traversing pointer.  The target string pointer bumps every iteration except when a wildcard is found.  If the filter-traversing pointer goes past the end of the filter, I have a match.  If the target-string pointer goes past the end of the string being checked, it's a negative unless the filter just has a "*" wildcard remaining.  I'm going to fold in "?" wildcard processing once I get this up and running.

Now your a real programmer!
Seriously, I have seen people wrack their brains for weeks making things more efficient, and for what? Saving seven ticks. Seriously, that was it, they were so proud that after countless hours working with some insane maths, they save them self an impossibly small amount of time on an algorithm that isn't even extensively used.

Efficiency is nice, and you should aim for it when ever possible, but be reasonable.

Yeah, I try to keep the balls-to-the-walls efficiency for the stuff being called thousands of time per second.  I've been talked to about keeping things readable -_-

Stargrasper

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #259 on: January 09, 2012, 12:00:06 pm »

I can't really drink, sadly.  Alcohol and my meds don't mix.  Incidentally, one of those drugs is a sleep drug.  Which is why I keep disappearing for a few hours around 3AM while Max is here all night.

Yea but I'm already on the path from dwarven drunk to hobo drunk.
Best not to drink alone from here on in.

Come here and drink with me.  If I'm going to be awake all night, I might as well have someone to talk to.
Logged

Levi

  • Bay Watcher
  • Is a fish.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #260 on: January 09, 2012, 12:06:58 pm »

The real difference between their typing system is that Ruby has a dynamic typing system as opposed to Java's static typing system. It certainly doesn't imply the language is typeless, just that types work differently.

Ah, that was the terminology I was probably looking for.  Thanks.  :)
Logged
Avid Gamer | Goldfish Enthusiast | Canadian | Professional Layabout

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #261 on: January 09, 2012, 12:07:38 pm »

Sometimes I just wish I could make games without players... Having to take care of input and translate that into actions is so much more tedious and annoying than just making AI...

Willfor

  • Bay Watcher
  • The great magmaman adventurer. I do it for hugs.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #262 on: January 09, 2012, 12:11:00 pm »

Make a game where AI fight AI, and the player watches. I've wanted this since I played Skirmish Mode in Red Alert 2. Silly AI, I want to watch you fight each other, and not just me!
Logged
In the wells of livestock vans with shells and garden sands /
Iron mixed with oxygen as per the laws of chemistry and chance /
A shape was roughly human, it was only roughly human /
Apparition eyes / Apparition eyes / Knock, apparition, knock / Eyes, apparition eyes /

Stargrasper

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #263 on: January 09, 2012, 12:11:18 pm »

Sometimes I just wish I could make games without players... Having to take care of input and translate that into actions is so much more tedious and annoying than just making AI...

You can.  They're called movies.
Logged

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #264 on: January 09, 2012, 12:14:17 pm »

I am now making gratuitousness space battles as a roguelike, and nobody can stop me!
But on a more serious note, this is amazing.
Spoiler: Not mine (click to show/hide)

I mean really, as far a roguelikes go how good that that look? Sort of wish that they had printed the frame around the main box before printing the trees, but what ever.
Point is I'm totally looking to do scrolls and books and anything read in the same way they did that item description, it looks really nice.

Stargrasper

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #265 on: January 09, 2012, 12:16:52 pm »

I am now making gratuitousness space battles as a roguelike, and nobody can stop me!
But on a more serious note, this is amazing.
Spoiler: Not mine (click to show/hide)

I mean really, as far a roguelikes go how good that that look? Sort of wish that they had printed the frame around the main box before printing the trees, but what ever.
Point is I'm totally looking to do scrolls and books and anything read in the same way they did that item description, it looks really nice.

I'm more and more desperately wanting to work on a project of my own...I wish I could get JCurses to actually work...
Logged

Willfor

  • Bay Watcher
  • The great magmaman adventurer. I do it for hugs.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #266 on: January 09, 2012, 12:18:08 pm »

Yeah, I think the primary advantage of libtcod is using the full color display to your advantage. I love playing around with the different ways you can color the screen to great effect. I've made basic cutscenes in it before.
Logged
In the wells of livestock vans with shells and garden sands /
Iron mixed with oxygen as per the laws of chemistry and chance /
A shape was roughly human, it was only roughly human /
Apparition eyes / Apparition eyes / Knock, apparition, knock / Eyes, apparition eyes /

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #267 on: January 09, 2012, 12:23:00 pm »

I'm more and more desperately wanting to work on a project of my own...I wish I could get JCurses to actually work...
That is how I felt, and then I saw Aquizar post something in the happy thread and I was like 'dammit man!', Imma gonna rogue up!
Plus this way I'm getting used to all the little bitchyness of libtcod for c#, so tech support ahoy!

But seriously, once you know what you are doing you can make cool shit happen. For example, that main screen in the middle is printed on an offscreen console, then blitted onto the main console, so I can easily move it around and change the alpha value. Observe!

Spoiler (click to show/hide)

Levi

  • Bay Watcher
  • Is a fish.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #268 on: January 09, 2012, 12:24:35 pm »

Bah, I should really get back to my project instead of playing video games every evening.  Maybe I'll start it back up tonight.
Logged
Avid Gamer | Goldfish Enthusiast | Canadian | Professional Layabout

Stargrasper

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #269 on: January 09, 2012, 12:46:53 pm »

With JCurses, I remember not being able to get it to initialize.  And with libjcsi, I remember the getch command just plain not working.  I didn't like ncurses for C++ just because C++ won't let me initialize the size of a 2d array at runtime.  C++ is otherwise great, though I never tried running libtcod in it; I only tried building my own engine.  I can't remember what, but something about the mechanics of Python annoyed me...  It doesn't help that none of these libraries (except maybe ncurses itself) has been updated in years.

So, should I spend my day trying to get Java to run JCurses or libjcsi, trying to get C++ to run libtcod, trying to get Python to run libtcod or Pygame, trying to learn Clojure, trying to learn C#, trying to re-invent my custom roguelike engine that I coded in Java a couple years ago because I couldn't get JCurses or libjcsi to work (yes, I coded my own engine from scratch in Java because I got frustrated at the existing ones), writing another two Java tutorials, doing my homework, or fixing my computer?  Hm...decisions, decisions...
Logged
Pages: 1 ... 16 17 [18] 19 20 ... 796