This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
oli414's profile picture

Adventure Game [Pocket]

Started by oli414, 09 March 2015 - 06:16 PM
oli414 #1
Posted 09 March 2015 - 07:16 PM
Hi everyone,

I've used Computercraft for a few years now but never really posted any of my creations on the forums. Most of the time I don't complete my projects because I lose interest in them and don't want to dissappoint people by making a topic and not finishing my projects.
But I recently started working on game I had in mind for quite some time, and I'm pretty sure I will finish this project…

I'm creating an Adventure Game inspired by games like Pokémon and The Legend of Zelda.



The user controls the player (the &) using W A S D.
In the game there are certain objects which can be picked up by walking on top of it, but only if you have the required object to pick it up, otherwise you won't be able to walk through it. When you do have the required object the object you're picking up wil be added to your inventory and it'll remove one of the required item to pick it up. For example, a chest takes a key, the player needs to have atleast one key to walk onto the chest, if the player has this key he'll be able to walk onto the chest and 1 gold will be added to the player's inventory and the chest will be removes from the screen.

The player can open his inventory and it'll show a list of all the objects the player has with the amount in front of it. The player can select certain objects using enter, if the player presses enter and the selected objects form a crafting recipe, the recipe objects will be removed from your inventory and you'll be given the crafted object.

Each object has 8 properties:
Object ID (Unique ID)
The graphics (one character and two numbers)
ID of the required object to break this one (0 if nothing is required)
ID of the object the player gets when he picks it up (0 if the player gets nothing)
Amount of the objects the player gets when he picks it up
Crafting recipe to create this object (List of object ID's, 0 if it's not craftable)

These objects can be used for all sort of things, I could make an Stone object which would require a pickaxe to break and the pickaxe can be crafted using wood and a rock,
but I could also use it for a door, the door requires a key to break and the door gives the player nothing when it breaks, neither is it craftable.

The world also consist of different files, it contains the X and Y of the screen, tiles and objects.

And that's basically all the technical parts to this game, the technical part of this game is supprisingly simple, but that's not what makes this game fun to play.
I've finished all the technical parts and now I've to create objects and screens that make this game fun to play.
This will be the gameplay of this game:
The player enters a new area, the player will explore the area and find out what unique objects there are in that area. It'll also find a spot where the player won't be able to continue because a certain item is needed. The player will have gather objects needed to craft a special object which is then needed to continue in this area, this special objects could be something like a tool (pickaxe, shovel) but also something like a boat, a grappling hook or just a sword.
Eventually the player will find the dungeon of that certain area, in the dungeon the player will have to find keys to continue, maybe solve puzzels using the tool it created before or maybe fight some monster objects using a sword object. Once the player finished the dungeon he'll get a special object which is needed to continue to the next area.

And that's all you need to make a game, a player, a map, objects, and creativity.
The script is only 475 lines long and it won't get any bigger, however the assets is what this game is all about.
I'll keep you up-to-date about progress I make on this project, there's one feature (which is the main reason why I'm creating this game) that I haven't implemented yet, I won't tell you what it is because I might use this game concept for an actual game if it turns out to be fun.

If you've got any questions please feel free to ask!

More screenshots:
The inventory screen (The white objects are selected for crafting, the grey object is what the cursor)

When you enter a new area you'll get to see the name of that area for a few seconds
TheOddByte #2
Posted 09 March 2015 - 09:04 PM
This looks very good, it feels like you've put a lot of time into it as it seems from the screenshots, how does it work with regular computers? If you release this it feels like it should support regular. But I'm quite amazed that someone actually put time into creating a game for pocket computers, because it feels like there has not been a lot of games or programs released for them for that matter.

Now I'm wondering, what exactly is this game going to be? Because Zelda and Pokemón are two totally different games, and I'm not sure what to expect from this when you say that it's inspired by those two, is it the art-style that inspired by? How is the battles going to be like? Like Pokemón or Zelda? I'm basically wondering, will it be turn-based or not.

Anyway, I wish you good luck and hope that you finish it. I can relate with the problem about finishing projects, I also got a lot of unfinished projects Dx
oli414 #3
Posted 09 March 2015 - 09:36 PM
^ Thank you very much,

I'm not planning on making it work with regular computers, the reason I'm creating this is because Computercraft is a great way to simulate real life networks and test around with it without the need of multiple real life devices (Like smartphones), I also just wanted to focus on the game idea I had instead of having to set up a lot of stuff that doesn't have anything to do with my game. I'll be making this game for mobile devices if it turns out to be fun. The network simulation is very important for this games development, I can't tell right now for what it'll be used unfortunately. The reason I've choosen for pocket computers is because they are like mobile devices, the platform I'll be making this game for if it turns out to be fun.

The game is Zelda inspired because you'll be exploring areas and then entering a dungeon with puzzles and (maybe) a bit of combat. The way these areas work is kinda similair to how it works in The Legend of Zelda (Get to the new area > explore area > find dungeon entrance > find out how to get to the dungeon entrance and what you'll be needing to get there > enter the dungeon > solve puzzles / combat > get item to progress through dungeon > solve more puzzles / combat > get to the end of the dungeon and get the item you needed).

The pokémon part is (I honestly don't know a lot about Pokémon, I'm just assuming…) collecting all the objects, which will probably be the main goal of this game, gotta get them all :-P You would get a better understanding of how this'll be fun and why it is kinda inspired by Pokémon if I were to explain the feature that I'm not going to talk about… I'm really sorry :-P, I think this game might actually be something that people will actually play on there mobile devices and I want to prevent someone else from stealing my idea and publishing it before I can.

So about battles, enemies will probably just be like the whole game. An object, probably with a special marker. Enemies will do one step in a (random / strategically choosen direction) everytime the player moves. The reason for this is that the player doesn't have to pay intense attention to the game, which never works for mobile games because people are playing them while they're on the move.
I haven't completely figured out yet how combat will work but enemies will probably work just like other objects, for example you would need a sword object to get rid of an enemy by walking on top of it, everytime you get kill an enemy it'll cost you one sword. So you'll have to be prepared. I'll probably add something that if you don't have a weapon and you try to kill an enemy that you'll "die", but I'm not sure if "dying" will add anything to the gameplay.
So in theory the battles will be turn based, but you won't get a screen pop up with a lot of attack and defend options or anything like that. I'll just be using the good ol' objects for this system aswell.

I hope this will help you understand it a little bit better. English isn't my first language as you might have noticed but I really hope it's understandable.
TheOddByte #4
Posted 10 March 2015 - 06:44 PM
gotta get them all
Gotta catch them all* :P/>
oli414 #5
Posted 10 March 2015 - 08:15 PM
You catch pokémons. Not objects :-p

I haven't been able to work on it today, I was trying to make a compression algorithm, but it I haven't been able to finish it because it takes over 2 hours to compress a 500 line program… oh well, might retry someday.
SpencerBeige #6
Posted 10 March 2015 - 10:19 PM
im making a game, and well…making items for it sucks! you have to program: the name, how to get it, how many you get, what else you get from make it it, can you place it, and then make some textures.
oli414 #7
Posted 11 March 2015 - 08:30 AM
Are you hardcoding your items? My game just reads everyfile in a specific folder filled with files for each object, in these files I just have to enter the values that object needs, the name of the object is determined by the file name.
TheOddByte #8
Posted 12 March 2015 - 08:42 PM
You catch pokémons. Not objects :-p
Well it was a Pokemón reference :P/>

im making a game, and well…making items for it sucks! you have to program: the name, how to get it, how many you get, what else you get from make it it, can you place it, and then make some textures.
How exactly are you doing this? This shouldn't be that complicated, stick the objects into a table, for example, I've created a level editor and simply put all the tiles into to a table like this

local tiles = {
    {
        name = "Dirt";
        id       = "0";
        art     = " ";
        color = nil;
        background = colors.brown;
    },
}
And then simply accessed that table when drawing the map( checking the tile's properties etc. )
oli414 #9
Posted 12 March 2015 - 10:05 PM
^ I should probably make a level editor and object editor aswell, will make it a lot easier to create this game that way. Might even do it in C++ since it'll be a dev tool.

Today and yesterday I spent time in making my workspace more efficient. I've setup a webserver to store scripts, the webserver works in combination with a lua program I've written, which I've put into the rom so I can access all my lua programs from any Computercraft computer.
The program has 3 functions, upload, download and edit:

bbox upload <file to upload> <filename on server>
bbox download <filename on server> <location to download to>
bbox edit <filename on server>
The last one is a wrapper around the standard edit program, it downloads the file I'd like to edit from my webserver and stores it into a temp folder, that it just runs the edit program and when you exit the edit program it'll upload the file and remove the temp folder. Pretty simple, but it's usefull as classes! < See what I did there?
SpencerBeige #10
Posted 14 March 2015 - 02:27 PM
You catch pokémons. Not objects :-p
Well it was a Pokemón reference :P/>/&amp;gt;/&amp;gt;
im making a game, and well…making items for it sucks! you have to program: the name, how to get it, how many you get, what else you get from make it it, can you place it, and then make some textures.
How exactly are you doing this? This shouldn't be that complicated, stick the objects into a table, for example, I've created a level editor and simply put all the tiles into to a table like this
 local tiles = { { name = "Dirt"; id = "0"; art = " "; color = nil; background = colors.brown; }, } 
And then simply accessed that table when drawing the map( checking the tile's properties etc. )
im not using a file, im using a custom file read thingy. for example:
item:how_to_get_it:
stone:break*stone

and im still working on it

edit: although, using a table is a nice idea. i might use that…
Edited on 14 March 2015 - 01:28 PM
TheOddByte #11
Posted 15 March 2015 - 09:47 PM
Well it simplifies it so much by using a table, your method kinda sounded like a lot of unnecessary work IMO.

Do it! Create a level editor! :D/> :P/>
oli414 #12
Posted 15 March 2015 - 10:10 PM
The good ol' problem of too many projects is here again. I wonder if I'll ever finish a project in my life…
Haven't done any work on the game unfortunately. Kinda busy at the moment :-/
TheOddByte #13
Posted 15 March 2015 - 11:30 PM
Well that's usually what happens, you find yourself lacking time, which eventually leads to lack of interest, which then leads to abandoning the project.
I hope this won't be the case for you, because I've been down this road a lot of times and I wish I could finish a project.
Geforce Fan #14
Posted 16 March 2015 - 09:25 PM
The good ol' problem of too many projects is here again. I wonder if I'll ever finish a project in my life…
Haven't done any work on the game unfortunately. Kinda busy at the moment :-/
don't worry, in 6 months time you'll pick them back up again.
TheOddByte #15
Posted 16 March 2015 - 09:27 PM
don't worry, in 6 months time you'll pick them back up again.
Does that apply for me as well? Because it's been well off 6 months for me with some projects :P/>
oli414 #16
Posted 17 March 2015 - 10:26 PM
6 months ago I was working on a c++ 2d adventure game with infinite procedurally generated terrain… got the infinite procedurally generated terrain part done… 4 months ago I was working on a logic gate simulator… Got the logic gate part done… 2 months ago I was working on my website… was about to make a devblog… Last week I was working on this game… And this week I'm working on a browsergame, which suprisingly enough is almost finished.

Nah, I rarely work on projects again after I've abanonded them. Ideas most of the time aren't as awesome as you thought they were when you start a project, however, I'd pay millions of euros if there was a medicine that made you finish all your projects.

Back on topic,
the chance that I'll finish this project is very small, I might release the code if people are interested in seeing it, but don't expect anything special
Edited on 17 March 2015 - 09:28 PM
vargaszm #17
Posted 20 March 2015 - 10:19 PM
Where's teh download link?
dan200 #18
Posted 27 March 2015 - 02:12 AM
This is beautiful, very excited to play it some day
Geforce Fan #19
Posted 27 March 2015 - 02:29 AM
the chance that I'll finish this project is very small, I might release the code if people are interested in seeing it, but don't expect anything special
This is beautiful, very excited to play it some day
dan200 just said it looked fun.
You are required by computercraft law to release something now.
The script is only 475 lines long and it won't get any bigger
How'd you even manage this?!?!?!
My game-engine is 1,513(probably more by now) lines long!
Edited on 27 March 2015 - 01:32 AM
oli414 #20
Posted 27 March 2015 - 10:30 AM
EDIT: Please note that this project is not finished.

This was kinda unexpecting :-P That's the reason I don't often share my projects, now I gotta finish it….

In case this projects stays abandoned, here's all you need to try this out (or expand it):
The actual code, this is what you launch,
http://pastebin.com/LJmAwqmY

Than there are three folders in the same directory as the script above:
areas
objects
tiles

To create an area you'll have to add a folder to the areas folder with the name of what you'd like to call that area,
inside of this folder you'll put all the screens that are in this area. The name of this folder is shown when you enter this area. Every screen has the size of a pocket computer and uses this format, the name of this file doesn't really matter:

number (X coordinate of where this screen is)
number (Y coordinate of where this screen is)
number (Z coordinate of where this screen is (Functionallity NYI, use 1 as Z coordinate))
tile-numbers (520 numbers seperated by a space, the number corresponds to the tile ID)
object-numbers (520 numbers seperated by a space, the number corresponds to the object ID)
Example: http://pastebin.com/ED8qq9mm

Than in the objects folder there are files for every object in the game, objects have this format:

number (ID of this object, this number needs to be unique, there can't be another object with the same ID)
character (The character drawn on the screen)
color (The background color drawn on the screen)
color (The character color drawn on the screen)
number (ID of the object the player needs to break this object, if always breakable use 0)
number (ID of the object this object gives to the player when the player breaks it, 0 for nothing)
number (Amount it gives the player)
number number number... (Crafting recipe for this object, all the required object IDs seperated by a space, 0 if this object can't be crafted)
Example: http://pastebin.com/i16uJVHb

And than there are tiles, which use this format:

number (Tile ID unique ID to identify all the tiles)
character (character drawn to the screen)
color (background color drawn to the screen)
color (character color drawn to the screen)
type (1 for solid, 0 if the player can walk on it)
Example http://pastebin.com/6p7mEgKC

And here is the full project including all the areas, objects and tiles I made:
http://oli414.com/do...nture_game.html

If there're any questions please feel free to ask them!
Edited on 27 March 2015 - 09:42 AM