Git Product home page Git Product logo

cobalt-calibur-3's Introduction

Cobalt Calibur 3.x

Cobalt Calibur 3.x Screenshot

Cobalt Calibur 3 is a rather old (2012) browser-based sandbox game. The backend is written in Node.js (originally Node.js v0.8!). Data is pushed using WebSockets. The frontend uses the HTML5 Canvas tag to handle drawing of the map, and the map is sized when the page loads to fit the size of the users screen. It also uses some HTML5 audio for sound effects.

Example Server: cobaltcalibur.net

How To Play

Movement is done with the WASD and arrow keys. Pressing 1-6 will attempt to build the specified tile. Pressing F will attempt to harvest / mine / chop / collect the tile in front of the player. As you harvest materials, your inventory in the upper right will increase. As you place tiles, the inventory will decrease. Unlike other building games (e.g. Minecraft), you don't keep the items you created in inventory, just the raw materials.

Synthetic Tiles:

  1. Wooden Wall (4 wood)
  2. Wooden Floor (2 wood)
  3. Stone Wall (4 stone)
  4. Stone Floor (2 stone)
  5. Wooden Door (12 wood)
  6. Glass Window (4 sand)

Placing synthetic tiles will cause the corruption to slowly be pushed away. Doors will block enemies but will not block players.

Naturally Occurring Tiles

  • Trees: Mine to receive 2 wood, becomes stump
  • Stump: Mine to receive 1 wood, becomes grass
  • Grass: Walk on it. Randomly becomes tree
  • Dirt: Walk on it. Randomly becomes grass
  • Big Ore: Mine to receive 2 ore, becomes small ore
  • Small Ore: Mine to receive 1 ore, becomes rubble
  • Big Stone: Mine to receive 2 stone, becomes small stone
  • Small Stone: Mine to receive 1 stone, becomes rubble
  • Rubble: Mine to receive 1 stone, becomes dirt
  • Water: Makes sand from adjacent ground

Every morning, grass can grow a tree, dirt can grow grass. Dirt and grass adjacent to water will become sand. When there is an earthquake (every few days), it will deposit more stone and ore into the world (and possibly damage buildings).

When the server starts, NPCs can spawn on naturally occurring tiles. They then walk around, (currently) never dying.

Game Mechanics

Walking in the corruption has a chance of hurting the player. Standing adjacent to an enemy will hurt the player. Enemies have very simple AI, they move towards the player. There are day and night cycles, but they don't affect gameplay much. There are occasional earthquakes, and they change the landscape. Health slowly gets restored.

Installation

$ npm install

Running Game Server

You'll want to specify the port number as the first argument to the script:

$ ./server.js 8000

You can also run it using Docker:

$ docker build -t cobalt-calibur .
$ docker run -p 8000:8000 -d cobalt-calibur

cobalt-calibur-3's People

Contributors

calvinbushor avatar kalisjoshua avatar tlhunter avatar zarel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cobalt-calibur-3's Issues

Character "Ghosts"

Sometimes, characters will be ghosted, like if you refresh the page you can sometime see an old version of your player

Massive Frontend refactor

Just got done with a swizzeet backend refactor. We're going to need to do a big refactor of the frontend before we can make any massive cool new features.

I'm thinking use Browserify, and break the chunks of code up into smaller modules similar to the backend approach. Shouldn't need a massive game object anymore.

Anticipated modules:

  • bootstrap
  • environment
  • player
  • npcs
  • persistence
  • players
  • network
  • graphics
  • chat
  • audio

Update /help

The /help docs talk about SHIFT to turn, and other outdated things, which should be updated.

separate frontend/backend code

Awesome project! I was looking for something just like this. Only a few problems:

I'm not very interested in Node. If I were to play/contribute, would almost certainly implement a clojure backend... which brings up the idea, do you have any plans for this?

Additionally, is there any clear reason to not have used coffeescript? I much prefer coffeescript, personally.

Immediate Time

Player needs to know the time as soon as they log in.

XSS

escaped HTML is being unescaped when the text is written back into the DOM

NPC & PC unification

I think there should be some classical inheritance introduced to the class system so that all characters inherit some basic features; eg. x, y, direction.

Any recent successes installing Cobalt Calibur 3?

On 64-bit CentOS 6.4, I am unable to run Cobalt Calibur 3.

MongoDB version is 2.4.5, node version is v0.10.12, and npm version is 1.2.32.

I verified MongoDB was running. I unzipped a current GitHub master archive of Cobalt Calibur 3 into /var/www/html and ran "npm install" from that directory. After that completed, "node server.js 80" returns the following:

Express Attempting to listen on: 127.0.0.1:80
MongoDB The map in Mongo is null
MongoDB Attempting to build the database

/var/www/html/Cobalt-Calibur-3-master/node_modules/mongodb/lib/mongodb/connection/server.js:594
throw err;
^
TypeError: Object # has no method 'collection'
at buildMap (/var/www/html/Cobalt-Calibur-3-master/server.js:395:8)
at /var/www/html/Cobalt-Calibur-3-master/server.js:545:21
at /var/www/html/Cobalt-Calibur-3-master/node_modules/mongodb/lib/mongodb/collection.js:998:5
at /var/www/html/Cobalt-Calibur-3-master/node_modules/mongodb/lib/mongodb/cursor.js:685:35
at Cursor.close (/var/www/html/Cobalt-Calibur-3-master/node_modules/mongodb/lib/mongodb/cursor.js:899:5)
at Cursor.nextObject (/var/www/html/Cobalt-Calibur-3-master/node_modules/mongodb/lib/mongodb/cursor.js:685:17)
at commandHandler (/var/www/html/Cobalt-Calibur-3-master/node_modules/mongodb/lib/mongodb/cursor.js:658:14)
at null. (/var/www/html/Cobalt-Calibur-3-master/node_modules/mongodb/lib/mongodb/db.js:1666:9)
at g (events.js:175:14)
at EventEmitter.emit (events.js:106:17)

Have I missed something obvious? Has anyone had any luck with a recent install of Cobalt Calibur 3? Has a more recent version of a dependent package broken the game?

Enemies need AI

Enemies should have some path-finding capabilities and hunt down players.

Change Map Format

Right now, the map is a 200x200 array (40,000 items). Each item is an array containing an ID and "health" of a tile. The game took a different direction though, and we no longer need health. It was going to work like a tree has 20 health, mine it, get 1 wood, and it now has 19 health, but it changed into you hit a tree, get 2 wood, tree becomes stump. Hit a stump, get 1 wood, stump becomes grass.

Lets make it a big array of just integers, and increase the size to 1024x1024.

Save Data more frequently

Need to save local changes as soon as they happen, instead of every 5 seconds. Might need to change the keys, but this would require pulling over old data.

List of Players

The server isn't properly storing a list of users. When a new player logs in they don't get a proper list of users. As a hacky fix the client sends it's info every 15 seconds, this needs to go away too.

Instantaneous Corruption

Corruption can take a while before it is seen. The code which sends the corruption to the browser might need a little delay.

Clean up player/NPC draw code

When drawing players and NPC's, we check every single on-screen tile to see if it has a player or npc. Instead, draw the terrain first, then loop through a list of NPCs and players, check to see if they are on screen, and draw them if this is the case.

Chances are there are less people than there are on-screen tiles, and this should speed things up a bit.

Invisible Avatar

I very frequently see people playing Cobalt Calibur with an invisible avatar. Need to find what causes that and fix it. Probably a network timing event issue race condition thingy.

Clickable Ranged Combat

Add simple ranged damage. Characters would need a clickable link above them, npcs as well. Might also need a list of characters in range so that they can be more easily targeted.

List of NPCs

Players need a list of NPCs as soon as they log in.

Server Side Accounts, Authentication

Need to provide username/password authentication, no more local storage for data saving. Will probably need to marry express.js sessions with websocket data.

Find who created avatars, credit or replace

I'm not sure who created the original character graphics.

This repository is evil for not providing proper credit.

Need to find out who made them and if we have permission to use them.

Update All the Modules

Need to run npm update in the root to get everything to the most recent version.

  • Express 3
  • Mongo is old
  • Socket.io is old too

Delete the mongo package, since we use mongodb.

Make sure the output of npm ls contains no errors.

Update all of the code in server.js which breaks due to the new packages. Socket.io, Mongo, and Express all go nuts.

Get a list of the packages that get installed, and add them to package.json. Then, delete everything within the node_modules directory, and add that to .gitignore. In the README.md file we should say that after the files are checked out, one needs to run npm update to get the latest files.

Server-Side inventory

Right now, everything is stored in localstorage, and is quite easily hacked.

There should be more server side validation, store all inventory info there as well.

Open socket later

We should probably open the socket later instead of sooner. The connection triggers some server side stuff, and I think the client side app isn't quite ready for it since it is still downloading assets.

Character movement map slide animation

When a character moves, there's a delay between when they can move again.

This makes sense for classic gameboy / NES / overhead games (think Zelda and Pokemon). Specifically why it makes sense is that the screen is animating between the old state and the new state.

Unfortunately it feels buggy in CC3 due to this lack of animation. Add the animation and we should be A-OK.

Socket Update (keydown?)

It seems like the socket update call is missing the last event fired. When I watch an avatar moving from another window it is always one movement behind.

Consistent movement speed

WASD movement is currently dependent on the speed of which the OS/browser sends keypress events. It should instead be triggered at a set interval for all players (e.g. every 200 MS).

If we add a speed attribute for characters, faster people could move faster, etc. We'll probably want server side validation, and if the player consistently moves faster than he should we kick them, since they could be hacking.

http://nokarma.org/2011/02/27/javascript-game-development-keyboard-input/index.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.