Showing posts with label HobbyRPG. Show all posts
Showing posts with label HobbyRPG. Show all posts

Sunday, December 15, 2013

[HobbyRPG] Menus!

Progress seems slow for the past couple of months, with my weekends either packed to the brim with events, or just me falling sick. Either ways, progress must somehow be made so here goes:


As expected, this inventory system takes a pretty long time to develop behind the scenes, especially since we were busy these 2 months, with concerts, live viewing, fighting game events, forcing myself to clear my backlog of games and being sick during my free time. I did felt that it would take under 2 months to complete so thankfully it did.

Only that I am absolutely clueless about RPG UI design on touch screen.

It's annoying when I could probably whip out a non-touch-screen design easily but couldn't do the same for touch. There is just so many considerations to take note of and it is rather painful at this moment to shift elements around. So I just whipped up the basic functions and moved my elements so that it is at least usable to me. Making sense of it and catering to players will have to wait =(

Setting up the UI requires a lot more work at the background. XML loading, LUA, additional macros to my XLS and new CSVs started popping out as development progresses. It may not look like much but it's feels like more work done compared to the other components that are in place now. It even involves a rather retarded bug fix within cocos2d-x that should not have happened.

Well, at least I'm going to start moving on to other gameplay elements like transitioning to another map. 

Monday, October 21, 2013

[HobbyRPG] Dialogs!

Dialogs!

Anyway, the last week was basically trying to get the game running on the device since we wrote so much code since the last time we tested (which is like...the beginning of time when we had only like 2 files or something). The thing is that we code in Visual Studio because it's an awesome environment, but our android is setup to use GNU compiler (cocos2d-x has some script that sets up for us). The screwed up thing is that it relies on a Makefile, which means I have to manually indicate which files need to be compiled. Fortunately, after some googling, modifications and thanks to the linux 'find' function (big hint here!), we now that a script that searches for all .cpp files and include them into the Makefile!


Anyway, so far LUA was pretty much pain in the ass. I was constantly trying to convince myself what is the right way to this X and Y mostly because I have like zero experience working with scripting languages on top of a native language. I can potentially write my whole game in LUA if I really want to; that's how much power it has. The only thing that's stopping me is that C++ is still our native (hurhur) language it probably has better performance and memory management (well manual memory management). There are other minor reasons too like wanting to make full use of our IDE, increase performance, etc. This is still a game that runs frame-by-frame, so it just does not make sense to me to write update loops in LUA.

Still, as the game progresses, the stuff that needs to be data-driven starts coming in and that's causing a few decision problems. It comes to the point where attempting to create 'generic systems' need to have feasible and reasonable boundaries, which also means NOT making it too generic. It's normally not a problem, but because I have loads of RPGs to reference in my head, I keep trying to hit all their features. It's really hard. Just the inventory and item system (which I am currently working on next) is giving me a headache. I could easily write out a chain of inheritance in C++ like having a UsableItems derived from a base Items class and then chaining a Armor class out of UsableItems class, but this is really unproductive especially since I have LUA. I'm trying to derive some way to just use one nice Item class. There's just too many variables to consider if it works for the limited RAM in my head, so I'll just code it out and see how it turns out.

Once the inventory is done, hopefully we can get item shops and equipment in and we'll be ready to FINALLY get started on combat. This might take awhile though ^_^;;

Monday, September 23, 2013

[HobbyRPG] tolua++ and menus!

This is turning into some sort of development blog, but from my perspective. Anyway, since LUA and UI were pretty big stuff we intend to add for this sprint, progress was seemingly slow due to time needed to research. I almost went into a huge hole of creating our own UI system but Dom managed to save me by just looking up cocos2d documentation -_-. I think when I figured that I could reinvent the wheel, I would just go ahead and do it without consulting Google or look for existing implementations.
Anyway, a not-so-glamorous progress to motivate ourselves!


For those who can't see the changes, I have neatly boxed them in red, since they are all code-based changes. Dom already told me a bit on how he intends me to use the UI, so I'll work on it once I can find better art. I'll try to follow his idea lol. 

LUA binding is a bitch. Well, it isn't once you know what's happening, but when you have no idea wtf is LUA, it's a bitch. cocos2d-x comes with tolua++ support, and I had no idea what that meant until I spent a couple of hours reading its online reference before I sneezed myself to bed on Saturday night. I felt super terrible yesterday, so terrible that I gave up on implementing it. Today I sneezed less, so I managed to get it working with a few good guesses. 

The documentation online for tolua++ is pretty heavy read for those who don't understand what's going on. Examples and tutorials are almost non-existent; in fact, the best tutorials I found were in Chinese or in Japanese. I totally gave up on the Chinese one. The Japanese one is easier to understand thanks to the existence of katakana. After seeing a few code snippets here and there, I finally figured it out. 

In a gist, tolua++ basically takes in a .pkg or .h file and generate a .cpp file with a function for you to call in your program. Then you just grab the lua state in your program (by right from tolua++.h, cocos2d-x has a wrapper around it) and throw it into the function that tolua++ gave you. I'm too lazy to explain in detail, but here's some poorly made step by step screenshots on how to expose a class to LUA:

First, get tolua++ to run on command line! Download the tolua++ executable and let adjust your Environment Settings' PATH variable to point to it. You know it's working when you open your command line and type "tolua++". The help page will appear:


Go to your project's root and create a .pkg file like so. Note that it looks almost like your .h file. These are the functions you want to expose. 


I must emphasize that the file included in the $cfile line MUST be accessible from the .pkg file's location. If not, tolua++ will complain.  Finally, just run tolua++: 


And voila, if there's no errors, you should magically have a file that looks something like below. If there are errors, well, just try to resolve them. Remember to Google for help (when in doubt, just Google the whole error message).


Add this to your IDE and pray that it works. If it doesn't, you screwed up somewhere in the .pkg file. If you have trouble, remember to Google, ask stackoverflow.com, attempt to find the answer in tolua++'s online documentation and/or actually try to figure out and guess how tolua++ binds your C++ code (it's not THAT magical). 

Moving on, the red box is the function you should be interested in. Simply call this function in your program and pass the lua_state in. The next screenshot is a cocos2d-x example since they have a wrapper: 

And now, when I run my script it works! (script is in first screenshot).

After you have successfully done this, the entire online tolua++ documentation will suddenly make sense! *gasp*





Wednesday, September 11, 2013

[HobbyRPG] And it has began!

Remember the RPG game I wanted to make?


It took some time, but finally Dominic and I have something visible up ^_^.

This is using the awesome cocos2d-x and my native language C++.  This project is probably going to be very slow since we agreed not to think about monetizing or selling it, and use it as a side project to create the RPG we want to make, which is great since there is no pressure. We can't guarantee if we will get burnt out at some point, but so far progress has been really fun for us!

Honestly, coming out of Digipen showed me how much I really wanted to make an RPG. After over 5 years in studying game development, I have only managed to create a simple text-based RPG game, which was a fun experience. Unfortunately, RPGs are extremely tedious to get it right, so it was not exactly a viable option as a school project, or even for a game you want to sell. Over the past decade, we have only seen the RPG genre decline and decline, leaving only a handful 'good' ones which were mostly cult hits. Hmm, not exactly a good genre to throw money into.

With this, hopefully when we go into design, I can attempt to return to my daydreaming story-writing days. I used to write tons of stories and other crap for fun, but that was easily a decade ago before I picked up programming and pursued to have a sciences foundation, easily obliterating my story-telling abilities and also my English. I can also go back to using Fruity Loops (which is now a full fledged...thing!) and fall onto my rusty music background to create sounds though I have much less hope of that succeeding. 

This project has sooooo much to be done, but it's so fun making each component work. Right now we are still working on the overworld system and already have animations, input and collision done. We also went to excel and write a macro to export stats into .csv files to reading into the game. 


What I like about this project is that it keeps my game development skills sharp, since I am not really doing development as much in my company.  We are also able to put into place what we have learn in our companies into this project, so it is a good learning experience so far.