Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 622 623 [624] 625 626 ... 796

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

EnigmaticHat

  • Bay Watcher
  • I vibrate, I die, I vibrate again
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9345 on: April 15, 2016, 10:05:52 pm »

I feel like those are some cool themes but none of them are open enough to be the ONE theme.  If it was the whole list that would be better.
Logged
"T-take this non-euclidean geometry, h-humanity-baka. I m-made it, but not because I l-li-l-like you or anything! I just felt s-sorry for you, b-baka."
You misspelled seance.  Are possessing Draignean?  Are you actually a ghost in the shell? You have to tell us if you are, that's the rule

IWishIWereSarah

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9346 on: April 15, 2016, 10:27:20 pm »

I kinda hate more than half of those themes.
I mean, we have to do with "Shapeshift". But there was Adaptation and Mutation, and either of those were more general and more permissive, while encompassing nearly all of Shapeshift.
:(

Any, let's try to make a chimera fighting game :D
Logged

Emma

  • Bay Watcher
  • Romace plots aren't actually that bad
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9347 on: April 15, 2016, 10:44:18 pm »

This is kindof a letdown :(
The theme isn't that bad. As usual it's open enough to be interesting and there are multiple different ways in which it can be taken. I think I'm going to make a game where the player morphs into a shrub to hide themselves from enemies.
Logged

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9348 on: April 15, 2016, 11:01:03 pm »

FOTF is leaking.
Logged

Solifuge

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9349 on: April 15, 2016, 11:08:52 pm »

« Last Edit: April 16, 2016, 04:03:51 am by Solifuge »
Logged

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #9350 on: April 15, 2016, 11:35:18 pm »

Shapeshifting makes me think of mythology, movie monsters (The Thing, Terminator), sci-fi and fantasy in general. If it were me I'd try and do something simple where you're a monster pretending to be a person and your goal is to kill.
Logged

Emma

  • Bay Watcher
  • Romace plots aren't actually that bad
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9351 on: April 16, 2016, 05:03:06 am »

Shapeshifting makes me think of mythology, movie monsters (The Thing, Terminator), sci-fi and fantasy in general. If it were me I'd try and do something simple where you're a monster pretending to be a person and your goal is to kill.
:o That's actually... A way better idea than mine. I'm going to do something similar, probably in Twine because that's simple to use and relatively powerful.
Logged

TheBiggerFish

  • Bay Watcher
  • Somewhere around here.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9352 on: April 16, 2016, 05:04:17 am »

Now there's an idea that wouldn't work with adaptation or mutation.
Logged
Sigtext

It has been determined that Trump is an average unladen swallow travelling northbound at his maximum sustainable speed of -3 Obama-cubits per second in the middle of a class 3 hurricane.

Solifuge

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9353 on: April 16, 2016, 01:33:12 pm »

Twine is fun; I think Hitch used Frankensteined Twine in his last LD entry. For theme... I figured a lot of folks would be taking a The Thing or a Lycanthrope direction, so I thought going Overly Literal would be fun for a change. Hoping to do some cool visual effects with this, but we'll see what we can get done.

If you want to hang out for a bit, or help us figure out a third-act gameplay twist, my Jam Teammate and I are going to do a Twitch Stream of development over the weekend. It's going to be a bit of a slog, so some company would definitely be nice.
Stream Link: https://www.twitch.tv/hitchh1k3r
Logged

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: if self.isCoder(): post() #Programming Thread
« Reply #9354 on: April 16, 2016, 01:49:14 pm »

So I was looking for a way to hash 2D coordinates (a pair of 32-bit integers) so I could deterministically compare and store them in a c++ set, and I found a method that I implemented like this:

Code: [Select]
int hashx = std::hash<int>()(x);
int hashy = std::hash<int>()(y);
hash = hashx ^ (hashy << 1);

It seems to work, based on the results. Then again, the result is a 4-byte integer and it could be that I'm just not getting any collisions because the domain is so huge.

So my question is: what's going on here? What does std::hash do with integers, and what exactly does that bit-shifting and XORing operation do to combine the results? Is this actually a good hashing method?
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

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9355 on: April 16, 2016, 01:58:04 pm »

As far as I know, an int is just its own hash.

As hashing two of them, your method looks fine, and is probably better than my method, which involves multiplying one by a big number and adding them.

Though with mine, I know the upper limit of what they're likely to be.
Logged

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #9356 on: April 16, 2016, 02:09:33 pm »

Shapeshifting makes me think of mythology, movie monsters (The Thing, Terminator), sci-fi and fantasy in general. If it were me I'd try and do something simple where you're a monster pretending to be a person and your goal is to kill.
:o That's actually... A way better idea than mine. I'm going to do something similar, probably in Twine because that's simple to use and relatively powerful.
If I spent more time thinking about it I could probably envision a fairly deep roguelike from that. Maybe the goal is as simple as killing everyone in a building without anyone calling the police.
Logged

Shadowlord

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9357 on: April 16, 2016, 03:48:27 pm »

So I was looking for a way to hash 2D coordinates (a pair of 32-bit integers) so I could deterministically compare and store them in a c++ set, and I found a method that I implemented like this:

Code: [Select]
int hashx = std::hash<int>()(x);
int hashy = std::hash<int>()(y);
hash = hashx ^ (hashy << 1);

It seems to work, based on the results. Then again, the result is a 4-byte integer and it could be that I'm just not getting any collisions because the domain is so huge.

So my question is: what's going on here? What does std::hash do with integers, and what exactly does that bit-shifting and XORing operation do to combine the results? Is this actually a good hashing method?

I know nothing about std:hash, but... (assuming that it does not change the integer) oh gods what? You're literally XORing hashx with hashy multiplied by two (except more efficient because bitshift).

Every time you try to hash a pair of numbers where x=y*2 the hash will be zero.

(You can test it to find out if std::hash<int>()(x) is returning something other than x, and if so maybe it's not as huge a problem? Because then the hash won't be zero when x=y*2, it'll only be zero if hashx=hashy*2, and if hashx and hashy are evenly distributed across all possible int32 values, it'd be a lot less likely - like, really unlikely.)

(Even if it was the case, iirc it'd really be a huge problem if you were trying to compare hashes to see if something is identical to something else)
« Last Edit: April 16, 2016, 03:56:19 pm by Shadowlord »
Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: if self.isCoder(): post() #Programming Thread
« Reply #9358 on: April 16, 2016, 04:28:27 pm »

Yep, that method doesn't seem to work all that well... std::hash does change the integer though, and I have no idea what it does beyond that. More research is required.
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

EnigmaticHat

  • Bay Watcher
  • I vibrate, I die, I vibrate again
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9359 on: April 16, 2016, 05:33:35 pm »

So I was looking for a way to hash 2D coordinates (a pair of 32-bit integers) so I could deterministically compare and store them in a c++ set, and I found a method that I implemented like this:

Code: [Select]
int hashx = std::hash<int>()(x);
int hashy = std::hash<int>()(y);
hash = hashx ^ (hashy << 1);
You can't use a hash to store coordinates (or any other data for that matter) because different inputs can result in the same hash.  You can start with a value and get its hash, and thus compare if a hash and value are equivalent.  But you can't start with a hash and walk backwards to get the value that created it.
Logged
"T-take this non-euclidean geometry, h-humanity-baka. I m-made it, but not because I l-li-l-like you or anything! I just felt s-sorry for you, b-baka."
You misspelled seance.  Are possessing Draignean?  Are you actually a ghost in the shell? You have to tell us if you are, that's the rule
Pages: 1 ... 622 623 [624] 625 626 ... 796