Javascript with JSON, HTML5, & CSS/CSS3 - RPG game??

C++, C#, Java, PHP, ect...
Post Reply
User avatar
KingScar
Posts: 54
Joined: Wed Sep 08, 2010 5:08 pm

Javascript with JSON, HTML5, & CSS/CSS3 - RPG game??

Post by KingScar »

Hey guys,

I've been working on (in my opinion) a pretty solid rpg game idea but......I have a few issues...


I'm pretty good with javascript and I know how to properly code and design a pretty basic JSON document layouts but I'm still pretty new to it.

I wanted to do it as a text based RPG with graphics, work out the code as best as possible, get the storyline down well, the races/classes stats etc. pretty much get all the key components of the game down to where I like them and see how things go. JSON seemed like the perfect thing to implement into game data storage and from what i've seen, it's not heavily documented on the net but I can't really see a reason why given some of it's capabilites and how light weight it is.

Eventually, my ultimate goal would be to bring the game into Unity and do it as a full 3D MORPG and just transcribe the "text based" code into Unity's form of Javascript. :)

BUT...I want the game to rely on JSON heavily as far as data storage goes for the game and even help with some of the layout with the CSS & replacing tables for JSON objects.

I was wondering is there a way to pretty much use JSON for storing stuff like:

Races, Classes, & Factions: also stuff like for races, each of their base attributes the player starts with and for classes, the stat modifiers each of them give and for factions, the difference in types of gear and even possibly quests available to you.

Character Attributes & Profile: use JSON for holding and displaying the players stats & skills on their profile when it it visited. (wins & losses, strength, wisdom, agility, etc)

Guilds: Same concept as the 'Character Attributes & Profile' idea except for Guilds.

NPCs & Questgivers: for holding and displaying NPC characters and what they have to say & when also what quests can be given & for what level range and even their image file path. In general, the AI of the game.

Game Objects: actual in game objects the player can interact with or pick up or equip and their stats.

Saving your game: holding players data in some sort of secure JSON database if that's even possible.

**EDIT:

Also, if this IS all possible as far as making a text based browser game goes, how well could the "JSON" theory be implmented within a 3D enviorment like Unity?


I hope you guys can help me out with this!


Thanks,

Ryan
Advanced:Html(XHTML), CSS, Writing
Intermediate: php, MYSQL, Level Design, C++, JavaScript
Beginner:Java, C-Lite, 3D modeling

The difference between me and you:

You: :geek: Me: :ugeek:

Image
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Javascript with JSON, HTML5, & CSS/CSS3 - RPG game??

Post by hallsofvallhalla »

As far as I can tell there is no good JS json options in Unity. There are several for C# however. You do not have the eval statement in Unity as well so no hacks to get it to work.

I could be wrong here though.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Javascript with JSON, HTML5, & CSS/CSS3 - RPG game??

Post by Jackolantern »

Unity can't parse JSON? How to-the-standard is the Javascript engine in Unity? Would it possibly have JSON.parse()? I can understand them leaving out eval(), since that is so easily abusable, but JSON.parse() is quite handy and they should have it if they don't :P
The indelible lord of tl;dr
User avatar
KingScar
Posts: 54
Joined: Wed Sep 08, 2010 5:08 pm

Re: Javascript with JSON, HTML5, & CSS/CSS3 - RPG game??

Post by KingScar »

I'm not quite sure about JSON.parse but, I know you can use eval() in Unity. I just don't know

A. if this is all even possible and if so, how it would run
and
B. how I could keep the code organized.
If I do it this way their's going to be A LOT of JSON objects. Could I write & save them as arrays and seperate files like Guilds.json, Classes.json, Races.json and than call them or certain parts of them as needed like calling a function or a variable? :oops:
Advanced:Html(XHTML), CSS, Writing
Intermediate: php, MYSQL, Level Design, C++, JavaScript
Beginner:Java, C-Lite, 3D modeling

The difference between me and you:

You: :geek: Me: :ugeek:

Image
Post Reply

Return to “Coding”