RPG game + LED pixel game system hardware

Post here to let others know of a project you're working on.

Moderators: Chuckt, Garth, bitfogav

Post Reply
User avatar
Saimaster13
I practically live here!
I practically live here!
Posts: 176
Joined: Mon Aug 13, 2012 4:23 am
Location: Sarasota, Florida
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

RPG game + LED pixel game system hardware

Post by Saimaster13 » Thu Oct 11, 2012 10:21 am

I am working on making an RPG game. It will be kind of like the old Zelda games; overhead view, attack with a sword, although I will add more attacks like ranged and magic later. The game will have an emphasis on being able to modify it (it could be a game engine.)
Anyway, I'm starting with little features until it is up and running (I don't even have an LED display coded in yet.) The first version of it will have 1 8x8 matrix and will have at least 2 players, more if I have enough pins. Everyone will have a basic sword attack (a sword appears in front of them) which will hurt anyone it touches. So the first version will be a small death-match type thing to make sure it all works.

I have certain hardware in mind, please notify me if there is something better I could use, or a problem with what I have listed
Hardware:
*Arduino uno microcontroller (brain)
*small bi-color displays (a lot for bigger displays)
*595 shift registers to run the display with only 3 pins
*darlington transistor array arrays for current sinking
*4021BE shift registers for player control input buttons using only 3 pins
*4 (maybe more) LCDs and potentiometers to use with them (the LCDs will need some kind of thing such as a shift register to limit the pins used by it
*tact buttons




Anyway, planned updates: (currently all I have is basic movement and sword attacking ability, not even a screen)

*a bigger display, 16x16 per player ( 4 16x16 displays)
*a bigger display, 64x48 non-scrolling screen (same as map size)
*3 color display (red, orange/yellow, green)
*bigger maps and the game screen scrolls with the character
*ability to split the screen into 2-4 smaller screens that scroll to each character
*more maps and movement between maps
*special objects
*4 LCDs, one for each player to display score, health, npc dialog
*npcs
*quests
*npc movement
*enemies and enemy AI
*currency/money
*experience/leveling up
*items/powerups
*something to do for levels
*player houses?
*marrying?
*friendship system?
*saving



Code: alpha 1.00 Fully functional but mostly bare maps, shield and sword attack actions, tested player support up to 2 players, untested 4 player support, no menus, map warping, green and red map data (you can move through green data.)


Adventure alpha 1.00

Code: Select all

Look on page 3 for code
Last edited by Saimaster13 on Wed Oct 17, 2012 2:19 pm, edited 7 times in total.
Joshua

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by brad » Thu Oct 11, 2012 11:14 pm

Nice work Joshua - now your talking my language! - making games with LED displays!

I'd love to help out with this where I can (and as i posted in the other topic) I can help make the graphic conversion software for you.

I actually started working on a game just like this - programming in assembly (about 4 - 5 years ago!) Check out the video (fast forward to about 1:10 to see my adventure game - which was incomplete...)

User avatar
Saimaster13
I practically live here!
I practically live here!
Posts: 176
Joined: Mon Aug 13, 2012 4:23 am
Location: Sarasota, Florida
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by Saimaster13 » Fri Oct 12, 2012 12:30 am

What happened to that system anyway? Seems like a pretty cool idea.

Anyway, how did you make so the character avoided walls? I set it up by saving the character's last movement press, naming it the direction that they are facing (if the last movement the player made was to the right, then their direction is to the right, etc.) and then if a player moves into a wall, then they immediately are moved in the opposite direction that they went (if they went up into the wall, they are moved down, putting them back where they were.) Can you think of a better way to do this, not that I think the current way is a bad way, just want to know if there is a better way.

I could also use a quick tutorial on the shiftOut function on the Arduino if you or someone else knows how to use it when addressing multiple shift registers. I have no idea how to use this and made my own shift register code from scratch (I have yet to test it though.)

And thanks for the help by the way!
Joshua

User avatar
Saimaster13
I practically live here!
I practically live here!
Posts: 176
Joined: Mon Aug 13, 2012 4:23 am
Location: Sarasota, Florida
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by Saimaster13 » Fri Oct 12, 2012 5:27 am

Also, how do you usually code multiple colors? I'm planning on having separate data, one set for each color. Is that what has to be done?
Joshua

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by brad » Fri Oct 12, 2012 9:33 am

It's quite easy to prevent players from moving through walls.

You just need to check the pixel in the graphic data that is next to you (or above / below you) if there is a pixel there (i.e. there is a wall there) then you don't allow the directional button to be pressed.

Psuedo code:

Code: Select all

if wallpixel to the left of me is a 0 then
     check to see if left button pressed
endif
basically the code above is only ever going to check if the left button is pressed only if it sees that there is no wall there.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by brad » Fri Oct 12, 2012 9:35 am

Saimaster13 wrote:Also, how do you usually code multiple colors? I'm planning on having separate data, one set for each color. Is that what has to be done?
Multiple colors is quite easy - you just have them stored in different arrays, like this:

Code: Select all

Const RedDataMerryChristmas(107) As Byte = (%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%11111110,%00000100,%00011000,%00000100,%11111110,%00000000,%11111110,%10010010,%10010010,%10000010,%00000000,%11111110,%00010010,%00010010,%11101100,%00000000,%11111110,%00010010,%00010010,%11101100,%00000000,%00000110,%00001000,%11110000,%00001000,%00000110,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000)
Const GreenDataMerryChristmas(107) As Byte = (%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01111100,%10000010,%10000010,%01000100,%00000000,%11111110,%00010000,%00010000,%11111110,%00000000,%11111110,%00010010,%00010010,%11101100,%00000000,%10000010,%11111110,%10000010,%00000000,%01001100,%10010010,%10010010,%01100100,%00000000,%00000010,%11111110,%00000010,%00000000,%11111110,%00000100,%00011000,%00000100,%11111110,%00000000,%11111100,%00010010,%11111100,%00000000,%01001100,%10010010,%10010010,%01100100,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000)
You then just send the data out to their respective ports :)

User avatar
Saimaster13
I practically live here!
I practically live here!
Posts: 176
Joined: Mon Aug 13, 2012 4:23 am
Location: Sarasota, Florida
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by Saimaster13 » Sat Oct 13, 2012 2:18 am

First test mostly successful: the sword is bugged, but the players move and avoid walls, and I got everything to display. I took a video... but it has a big file size so I will not be able to upload it where I am now, but I'll try to upload it tonight or tomorrow. Working on making a permanent (not a on breadboard) display now, should have that done today too and I'll post a video of that also. I'll also try to add player buttons so they can actually control their characters.
Joshua

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by brad » Sat Oct 13, 2012 7:36 am

Good to hear the project is coming along. I have another game (that I didn't complete) that may help you out / give you idea's. It is a pac man clone called pixel man. The cool thing with this game is that even though it only uses an 8x8 Matrix - the game area is 32 x 32 and then screen will scroll in whichever direction you move. The hard thing also was making the bad guys move around and know where the walls are (so they can avoid them) and also to know where the player is so they can try and get him.

The code is in swordfish basic, just let me know if you want me to upload it.

User avatar
Saimaster13
I practically live here!
I practically live here!
Posts: 176
Joined: Mon Aug 13, 2012 4:23 am
Location: Sarasota, Florida
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by Saimaster13 » Sat Oct 13, 2012 8:42 am

Actually, that along with super pixel brothers was main inspiration for this project, if I hadn't seen pixel man, I would probably never think of the scrolling of the screen with you idea, and might have never started this project.
Joshua

User avatar
Saimaster13
I practically live here!
I practically live here!
Posts: 176
Joined: Mon Aug 13, 2012 4:23 am
Location: Sarasota, Florida
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by Saimaster13 » Sat Oct 13, 2012 1:35 pm

Got the videos

1 color explanation



3 color example (hard to see in the video, but the moving dot that looks red is actually orange)
Joshua

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by brad » Sun Oct 14, 2012 7:59 am

Really cool!

Thanks for the video's. I love seeing stuff like this. What are your plans for moving to different screens? Will the screen scroll as you move or will it just change to a new screen as soon as you try and move past the edge?

Have you come up with the plot for the game?

User avatar
Saimaster13
I practically live here!
I practically live here!
Posts: 176
Joined: Mon Aug 13, 2012 4:23 am
Location: Sarasota, Florida
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by Saimaster13 » Sun Oct 14, 2012 9:41 am

Well, I just typed a whole page of stuff about what I was planning on doing and it all got lost, so the short version:

The second and a third game if that is made will both have their screens scrolling along with the character and changing to a different map when the character goes to the edge of one.

There will be 2 or 3 games total as I am building up to the final one:
A 8x8 screen PvP game (which is in the video, I will also upload a video of an almost completed version a little later.)
After that possibly an intermediary game between that and the finished game.
A finished game, edge scrolling, bigger and multiple screens, npcs, etc. etc.

The PvP only one is almost done, I'll have another video of it up soon, and when it is done I'll post how you would make it.

As for the story of the game, I currently do not have a specific story for it yet, but I am thinking about it.
Joshua

User avatar
Saimaster13
I practically live here!
I practically live here!
Posts: 176
Joined: Mon Aug 13, 2012 4:23 am
Location: Sarasota, Florida
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by Saimaster13 » Mon Oct 15, 2012 4:13 am

Did you have an idea for the story Brad? I was planning on making it long and with a lot of side quests.


note: code updated to a playable beta state. Permanent controller hardware almost completed, LCD hardware is next


Hardware needed for near future version:

resistors (10k to pulldown the controller buttons and whatever values are needed for the 8x8 matrix)
buttons (for the controllers, I am using tact, 8 per contoller)
LCDs (optional, currently displays health and lives)
8x8 bicolor matrix
3 595 shift registers for the matrix
Arduino
one 4051 IC + one 4051 IC per controller up to 4 controllers (the game currently will support only 4 players, so if you want 4 controllers you will need five 4051)
headers for connecting each piece (optional, I am making each piece in different "modules"; the Arduino, the 8x8 matrix, the controller connectors, the controllers, the LCD connectors, and the LCDs are all on their own boards and I am connecting them with headers. This will allow for easy expansion/replacement of each piece so when I make a bigger screen or something, all I have to do is detach the old one and attach the new one.)
Joshua

User avatar
Saimaster13
I practically live here!
I practically live here!
Posts: 176
Joined: Mon Aug 13, 2012 4:23 am
Location: Sarasota, Florida
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by Saimaster13 » Mon Oct 15, 2012 2:08 pm

Here is the video I promised:



I have made a controller port and a controller since this video and I will post video and/or pictures when I take them.
Joshua

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: RPG game + LED pixel game system hardware

Post by brad » Mon Oct 15, 2012 7:40 pm

Your game seems to be coming along just nicely!

It would be great (like you said) to have different side quests. You could also have it so you can't go through certain doors until you find the key to the door - or maybe there could be certain riddles to solve when talking to different characters (the text would be displayed on the LCD)
Maybe there could even be different colours for the different parts of the game e.g. you would start off in the green forest - then make your way through the yellow desert and then you would eventually get to the red castle...

For your controllers, have you thought about using the old school NES or SNES control pads? they are super simple to interface to a microcontroller and only take up 3 I/O pins to give you eight buttons. each additional controller (with eight buttons) will only cost you one extra i/o pin I.E. if you had four controllers you would need in total 6 I/O pins.

Here's a link to some code in swordfish basic to interface a control pad. (I know you can buy them for about $3 each from ebay or itead studio i think).
viewtopic.php?f=21&t=211

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 8 guests