Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - zachprinz

Pages: 1 [2]
16
General / Re: RPG Data Serialization Methods
« on: August 16, 2013, 04:47:47 am »
For something like loading a string of text for the NPC to say, then yes, using Lua is definitely overkill. That article does eventually talks about some of the better use cases for why Lua was used, though. Things like NPC movements, handling quest branches, and enemy AI can all be handled in your scripting language.

But you had mentioned,

Quote
If you've already coded everything in C++ yourself, then I don't know of any reason you'd want to integrate Lua into your game, unless one of the core mechanics is letting the player write code.

Sure, that's definitely something you can have as part of your game, but the main reason people use scripting languages is because they get interpreted when they are loaded, so there is no compiling going on. That means you can make a quick change, and simply run your game again. There are also systems(Wolfire's Overgrowth engine is such an example) that will actually auto-load and make the changes when it detects a change in the script file.

Of course, this is all fine and dandy, but be aware that there is some overhead when running scripting code since it is interpreted at runtime.

As far as other data goes, like items, character stats, etc., how you load that really depends on what you want to interact with. You can use an XML file, a plain text file, a YAML file, a binary file, and the list goes on. If this is your first RPG, use what ever you are comfortable with!

I can definitely understand where things being loaded at runtime would be an advantage. I wasn't really sure if Lua had to be compiled. To be honest I didn't know about compiled vs scripting languages.

So the advantage in using Lua with c++ would be I wouldn't have to recompile the game to test and create content like npc dialog or movement. I could have the game/engine coded completely independently from its content. Sounds like a very clean almost encapsulated way of doing things. I'll start learning Lua.

About the RPG, I've been kind of making the same game over and over again, each time moving up languages, improving the classes and organisation of the engine/game and implementing superior methods (like this for example, moving from .txt files to Lua would be awesome!) So far I've made it (to some extent) in java and c#. C++ makes the 3rd language I've written it in.

Any tips for starting with Lua?

17
General / Re: RPG Data Serialization Methods
« on: August 16, 2013, 04:11:40 am »
Yeah, I don't think I'm going to use Lua. For the time being I'm looking closer at sqlite. The main reason I'm not using text files Is this entire project has been about learning and I know how to use them already, I'd rather delve into something new.

18
General / RPG Data Serialization Methods
« on: August 16, 2013, 12:45:12 am »
I've come to a point in my current project where I will need to start adding "content" (stats on items, dialog for NPC's, skills, etc.) and I have been debating how best to implement the serialization of these values.

I've found a tutorial that uses Lua to manage NPC dialog, but I'm curious as to why they are using Lua instead of c++. It seems like I could just create c++ scripts with the same information that they are typing out in Lua.
Tutorial link below
http://www.raywenderlich.com/30561/how-to-make-a-rpg

I've never used data serialization in a project before (unless you count reading in strings from a txt file) but the first thing I thought of was XML, I've also seen people using SQLite for some stuff. I've read some other things being mentioned like Boost Serialization and Googles protobuf, but pretty much know nothing about those (but for that matter I don't have much knowledge on any of these topics/libraries.)

While I'm fairly sure that I could get everything I need done by simply reading in strings (which I know I could do from a text file.) I've kind of assumed that there must be advantages to using the aforementioned methods which I could take advantage of.

I guess what I'm trying to find out is what benefit these methods would offer someone who is trying to add "content" (in my previously defined usage of the word) for an RPG style game.

I hope my question isn't too vague, thanks for any help.

Pages: 1 [2]