Database connections
Posted: 2014-03-22, 20:20
Hi! Just found Cafu and I'm about to go diving in this weekend. From what I've seen it looks like Cafu has pretty much everything required for a non-persistant FPS style game and that's fantastic, particularly since its GPL. However, I want to work on a persistant RPG (MO, not MMO - nothing massive about what I want!). The basic idea is a 3D multiplayer RPG scaled for a home based server that will probably never see more than 30 players (depending on the server's network bandwidth in each direction etc). I've played and loved MMORPGs for many years, starting with Meridian 59 back in the 90s - before I ever heard of Ultima Online or Everquest.
While I loved the MMOs I always wanted something that I could run at home and ... "adjust" to suite my play preferences (e.g. faster or slower advancement, more or less powerful items/skills etc). The closest product I've ever seen was Neverwinter Nights and it was fun in it's own way but I've never liked D&D rules and it was a 2.5D world which doesn't fit my ideas.
I realize that Cafu has no built in features for inventory or quests or other RPG style features but I can script and if absolutely required I can program in C++ to some degree so I'm looking forward to experimenting with Cafu (I've seen some forum posts about inventory etc which look promising).
What I haven't seen is anyone implementing a connection to an external detabase. There have been a few general questions without definitive answers but the questions were somewhat vague so the answers couldn't be very definitive. I'll try to be clearer
What I'd like to know is if it's possible to make a database connection (Say MySQL or PostGres) from Cafu scripts or would some C++ coding be required to allow connections and more C++ coding required to allow scripts to use that connection? Security on those connections, of course, would be my responsibility.
Also, can scripts access entity property values i.e. if I add a Strength property can a script set/retrieve that value?
My intent would be to save character stats, character inventory, character quest states, game entity states and locations, those sort of things required for a persistant RPG world. Of course I realize I have to implement the systems for the above, I just want to know if I can access and save all the data to a database.
P.S. I know scripting is based on Lua and Lua can indeed connect to many RDMS but being based on Lua doesn't necessarily mean being able to do everything that stand-alone Lua can do.
Thanks!
While I loved the MMOs I always wanted something that I could run at home and ... "adjust" to suite my play preferences (e.g. faster or slower advancement, more or less powerful items/skills etc). The closest product I've ever seen was Neverwinter Nights and it was fun in it's own way but I've never liked D&D rules and it was a 2.5D world which doesn't fit my ideas.
I realize that Cafu has no built in features for inventory or quests or other RPG style features but I can script and if absolutely required I can program in C++ to some degree so I'm looking forward to experimenting with Cafu (I've seen some forum posts about inventory etc which look promising).
What I haven't seen is anyone implementing a connection to an external detabase. There have been a few general questions without definitive answers but the questions were somewhat vague so the answers couldn't be very definitive. I'll try to be clearer
What I'd like to know is if it's possible to make a database connection (Say MySQL or PostGres) from Cafu scripts or would some C++ coding be required to allow connections and more C++ coding required to allow scripts to use that connection? Security on those connections, of course, would be my responsibility.
Also, can scripts access entity property values i.e. if I add a Strength property can a script set/retrieve that value?
My intent would be to save character stats, character inventory, character quest states, game entity states and locations, those sort of things required for a persistant RPG world. Of course I realize I have to implement the systems for the above, I just want to know if I can access and save all the data to a database.
P.S. I know scripting is based on Lua and Lua can indeed connect to many RDMS but being based on Lua doesn't necessarily mean being able to do everything that stand-alone Lua can do.
Thanks!