Survival Game Discussion

For discussions about game development that does not fit in any of the other topics.
Post Reply
User avatar
kaos78414
Posts: 507
Joined: Thu Jul 22, 2010 5:36 am

Survival Game Discussion

Post by kaos78414 »

This thread started as a talk about Minecraft, and Halls mentioned that a PBBG like this may be fun.

So I started talking about one. I built some of the framework for it just out of boredom.
Source: http://www.box.net/shared/t8mg0y4y5s
Database: http://www.box.net/shared/9o69117bav

It's built in CodeIgniter, and right now it's just the framework for making it a little more DRY than CI is right out of the box. I'll write a little about how to set it up if you'd like after this post.

So far, we know that we want it to dynamically generate the world, similar to Minecraft. I know we'll probably need tons of crafting templates, so the game doesn't get boring. Halls suggested that we have the game reset after a month, so that the point of the game is to survive the entire month, and get the highest score, by collecting the most resources and defeating the most monsters.

I'll probably have it generate Biomes. For instance, once a player logs in for the first time after a reset, the game will automatically generate their world, and deem whether it is a desert, artic, island, forest, jungle or whatever else I can think of. Each will have different vegetation, animals and hazards. Also, I was thinking maybe each biome would have a different "boss monster." It would be a randomly generated rare spawn, and killing it in your biome would net big points. (I'm not sure yet, but I was thinking dinosaurs for monsters). All this will hopefully add an element of re-playability.

Death is permanent, meaning you have to start over if you die. This adds to the need for a shelter.

If anyone has any suggestions or anything like that, feel free to share them. I'm curious as to whether or not this could turn into a real project for me (right now it's more of a prospect of a project). As I mentioned I'll provide some instructions and a basic outline of how CI works in the next post for anyone who wants to look at the source. There's not much to it so far, as I said it's just the base framework, no actual game functionality is there.
w00t
User avatar
kaos78414
Posts: 507
Joined: Thu Jul 22, 2010 5:36 am

Re: Survival Game Discussion

Post by kaos78414 »

To set this up to check it out on localhost, Just extract the rar archive using winrar or 7zip to your public html folder (for XAMPP users it's usually C:\xampp\htdocs )

Then open up phpmyadmin, or whatever mySQL manager you use, then create a database called 'survival', and copy and paste the SQL code and run it, it will create one table, called iwtl_sessions, (IWTL stands for I want to live, the database prefix is set to this, so its important that if you create new tables you prefix them with 'iwtl_'). You don't have to name the DB survival, but if you don't, make sure you open up database.php (located in application/config/) and change the config option there.

A quick overview of the framework I'm using:
I'm not sure many of you have had any experience in frameworks, but CI has a lot of features similar to other frameworks. After you've extracted the rar archive, you can navigate to localhost/survival/user_guide to see an up to date CI user guide. This will help explain what I don't cover here.

CI URL routing is done via naming conventions and through controllers. If you create a controller called 'halls', and create a function called 'index' in that controller, pointing your browser to localhost/survival/halls, will call the index function of the halls controller. It can be seen something like this: yoursite.com/controller/method/param/param etc etc. So if you create a new function called blog, and it excepts a paramater like blog_id, you may have URL's that look something like this: yoursite.com/halls/blog/[blog_id]

You'll see in the folder that I've created two controllers, one called 'home', and one called 'pages'. I don't wanna have to fully explain what they do, suffice it to say that the pages controller basically remaps function calls that match a given array to static views (IE, about, contact, terms of use, etc.). The home controller doesn't do anything right now except load the home page. In application/config/routes.php, you can see that I've set several routes, the first one is to set the default controller that CI pulls when it runs, and the next 4 remove the controller part of the url, so that when you go to the about page, the url doesn't look like this: localhost/survival/pages/about, instead it removes the 'pages' part, but still calls the pages controller. This is a useful feature but again, I don't want to go into too much detail about it here.

The only other thing I'll mention for now is that I've sort of built around the $this->load->view();, so though the user_guide tells you to load views this way, I've included a library that sort of bypasses that step. Instead of loading a full HTML file, a template is loaded for you, so that your views can contain as little code as possible, and so that there's less repeating in the controllers. All you have to do in your controller functions is this:

Code: Select all

//This will load a default view, so you have to make sure you set a value to make sure you load the view you want
$this->builder->run();

//Here we are setting up a couple of values, to pass them to the builder library and overwrite the defaults
$data['subtitle'] = 'My Controller'; // This will set the title of the page to My Controller - Survival v 0.1
$data['body'] = 'my_view'; //This will set the body to load a view page at application/views/my_view.php

$this->builder->run($data); // Now we just pass the values to builder and it takes care of all that. :D
You can see all the variables that can be changed by checking out the library, at application/libraries/Builder.php

It's good practice to keep most of your heavy code to your models and libraries, and keep all of the actual data handling out of your views and controllers. Anyway, if any of you do want to play around with it, let me know if you have any questions
w00t
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Survival Game Discussion

Post by hallsofvallhalla »

wow you are rocking on this!
User avatar
kaos78414
Posts: 507
Joined: Thu Jul 22, 2010 5:36 am

Re: Survival Game Discussion

Post by kaos78414 »

:D

And don't worry, I haven't forgotten about the GDD Organizer, I'm still working on that too. But since for now, I don't plan on publishing the GDD Organizer, the code is pretty messy and there's absolutely no security features.

If I do decide to devote more time to this one, I'm thinking the code should be as clean as possible, and be as secure as possible, since if I do finish it it will go public. One thing I'm having trouble with is figuring out a name for it. Any ideas?
w00t
User avatar
kaos78414
Posts: 507
Joined: Thu Jul 22, 2010 5:36 am

Re: Survival Game Discussion

Post by kaos78414 »

UPDATE: Added auth library and model, which will be used for login validation, registration and sending related emails. I'll upload the files later, I have to create a semi-public gmail account that I won't mind sharing the password to. haha
w00t
User avatar
kaos78414
Posts: 507
Joined: Thu Jul 22, 2010 5:36 am

Re: Survival Game Discussion

Post by kaos78414 »

This one will have to wait a few weeks. I'm going to concentrate on a few other projects, one of them being the GDD Organizer I plan to share with you guys. Check the thread for that to see development progress. :D
w00t
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Survival Game Discussion

Post by hallsofvallhalla »

hehe you sound like me with all those projects ;) so many ideas and only 10 fingers to code with
User avatar
kaos78414
Posts: 507
Joined: Thu Jul 22, 2010 5:36 am

Re: Survival Game Discussion

Post by kaos78414 »

Yeah haha :D

But the upside to having so many projects going is that in the process of one, I learn something that can be used to improve or extend another. That's the main reason I like to have so many going
w00t
User avatar
Bane_Star
Posts: 47
Joined: Fri Apr 23, 2010 4:31 pm

Re: Survival Game Discussion

Post by Bane_Star »

kaos78414 wrote:Yeah haha :D

But the upside to having so many projects going is that in the process of one, I learn something that can be used to improve or extend another. That's the main reason I like to have so many going
Same here,

On Topic, I'm a little bit peeved about minecraft, I've been working on an ISOMETRIC Diablo style, Browser Based Sandbox survival game, which NOW I'm getting comments like: hey that looks like minecraft..

I've not started work on my Biomes part, just the interface and character movement, damage systems, block types, datastorage, communications, chat, messaging, etc.. but I'd be willing to swap ideas around to get both projects more depth.
User avatar
kaos78414
Posts: 507
Joined: Thu Jul 22, 2010 5:36 am

Re: Survival Game Discussion

Post by kaos78414 »

The actual development of Minecraft is slow as hell IMO. I've been playing Alpha for a VERY long time, and it's just barely getting to Beta. It's not very buggy, but I feel Notch has a long way to go. But with or without Notch, the game will flourish, because it has an excellent modding community. I feel that it will keep evolving in a similar manner to games like Counter Strike, because of its ease of modding. I don't play vanilla minecraft anymore actually, I play with several mods: Mo' Monsters, Minerals, and several smaller ones.

Honestly I had forgotten about this thread and its associated project. I don't know if I plan on continuing it, but if you want suggestions or help with your project I'd be more than happy to help you out.
w00t
Post Reply

Return to “General Development”