Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Post What's on Your Mind

I babysat my niece and nephew. Tried teaching them how to play video games but I don't have lot of games for 5 year olds and they're not very coordinated. Classic Sonic and Crash Bandicoot Racing.

Idk, maybe it's the controller. Teaching them how to jump over a pit was impossible. They kept playing with the joysticks and all the other buttons.
So I stuck in the racing game. Just hold 'x' and steer. Simple right? No. They were driving in circles. Getting stuck against the wall. Going the wrong way. Took 10 minutes to finish 3 laps.
They'd be picking their nose like "why am I not moving?" So I tell them they have to hold the x button. "Oh" and they press X with the same finger they were picking their nose with.

kids are gross.
 
Also, I have a question. I'm making a database for a set of items that can happen multiple days a week. I decided, in order to save space, I would make 7 boolean-type columns, one for each day of the week. Is there a better way to do this? Originally I thought of using a single string-type column containing a character for each day of the week. Would this be a better choice?
 
Juan J. Sánchez":a0n35bju said:
Also, I have a question. I'm making a database for a set of items that can happen multiple days a week. I decided, in order to save space, I would make 7 boolean-type columns, one for each day of the week. Is there a better way to do this? Originally I thought of using a single string-type column containing a character for each day of the week. Would this be a better choice?
What platform?

I'd say the best option is to store them as a single 8-bit char type and using 7 of those bits as a mask for each day of the week.

Monday would be 0x01, Tuesday 0x02, Wednesday 0x04, Thursday 0x08, Friday 0x10, Saturday 0x20, Sunday 0x40

You'd use a logical AND & to test for days of the week and a logical OR | to set days of the week and to remove a day you'd AND & it with the NOT ~ of the day you want to remove.

days = 0 // Initialise to no days set
days |= ( 0x1 | 0x2 ) // Monday and Tuesday set
isMonday = ( days & 0x1 ) // check if Monday is set
days &= ~0x2 // Remove Tuesday

That would be the most efficient method. Unless your database software automatically uses integer bit masks for booleans (which would be awesome) - in which case might as well use 7 booleans.
 
Xilef":18xy8cn9 said:
Juan J. Sánchez":18xy8cn9 said:
Also, I have a question. I'm making a database for a set of items that can happen multiple days a week. I decided, in order to save space, I would make 7 boolean-type columns, one for each day of the week. Is there a better way to do this? Originally I thought of using a single string-type column containing a character for each day of the week. Would this be a better choice?
What platform?

I'd say the best option is to store them as a single 8-bit char type and using 7 of those bits as a mask for each day of the week.

Monday would be 0x01, Tuesday 0x02, Wednesday 0x04, Thursday 0x08, Friday 0x10, Saturday 0x20, Sunday 0x40

You'd use a logical AND & to test for days of the week and a logical OR | to set days of the week and to remove a day you'd AND & it with the NOT ~ of the day you want to remove.

days = 0 // Initialise to no days set
days |= ( 0x1 | 0x2 ) // Monday and Tuesday set
isMonday = ( days & 0x1 ) // check if Monday is set
days &= ~0x2 // Remove Tuesday

That would be the most efficient method. Unless your database software automatically uses integer bit masks for booleans (which would be awesome) - in which case might as well use 7 booleans.

I did a little bit of reading and found out it doesn't really matter, since I'm using SQLite3. But I'm still going for the char type.
 
Juan J. Sánchez":3lj1kvm1 said:
I did a little bit of reading and found out it doesn't really matter, since I'm using SQLite3. But I'm still going for the char type.
SQLite3's CHAR type looks a bit different to a C/C++ char which is what I was trying to get at. INT8 is the type that masking would be good for.
 
Injury":1pl8h6dk said:
Let's not think about that. Plans! We must make plans to embrace MV and Unity and push hard to get active members back.

<3
That's the spirit. I'm posting all about making a game lately. You guys should make something too!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top