Jump to content

Welcome to the Forum!

The best place to exchange builds and ideas! Vote for the best ideas and suggestions here.

Join the Avorion Discord!

Connect with other passionate players and talk about the latest news.
Discord

DLC Avorion Into the Rift Out Now!

Now available on Steam!
Steam
  • 0

Some idea about Multiplayer


Fenrisus
 Share

Suggestion

How i am see, here, possible to make a little "mmo" (and that will be better than multiplayer servers, but need to know how it generally coded). Singleplayer and MMO (not a multiplayer with 10 players online limitations.) Yeah that req. a major changes.

Well, my little  suggestion-things for it.

Server Side:

1) Try to remake players, galaxy, other, world database and etc - to MySQL. Only static data should be in XML or json.

2) Some advanced systems on LUA for server-side. (and for modding) just for example:

// lua function: doPilotAddMoney(pilotID, amount)
lua_register(m_luaState, "doPilotAddMoney", LuaInterface::luaDoPilotAddMoney);
//lua function: doPilotAddIron(pilotID, amount)
lua_register(m_luaState, "doPilotAddIron", LuaInterface::luaDoPilotAddIron);

and usage on server side (scripts): something like that:

 

function onKillShip(pilotID, shipID, moreInfo) -- kill ship callback, execute script
local player = getPlayer(pilotID) -- if ship killer is Player
if player == true then -- yeah! shipID killed by player
   if (isPirate(shipID)) then -- and if that ship from pirate faction
   doPilotAddMoney(pilotID, 5000) -- give a player additional reward!
   -- for example, reputation system!
   local sector_hasOwner = someFunc here.
   local owner = funcHere
   if (sector_hasOwner == true) then -- if here live some faction
   doPilotAddReputation(pilotID, 100) -- we adding a ++reputation!
   doPilotSendMessage(pilotID, "Notify: After you kill pirate, you reputation in that sector has been increased!")
   end
end 
end
return true
end

 

Client side:

1) MMO features for client-side. So, they should connect to some server. Maybe a Global Server List, where list of all servers (official) already hosted. Player select it ---> Some Window with Login/Registration on current server ---> Enjoy to play! hehe.

2) Changes to Singleplayer mode.

I am talking about idea, same as in old old MS game Freelancer (

)

 

But generally, all of that only concept-idea.

Mainly - i am will be very happy to see that game (how in Freelancer) with singleplayer and with online servers, where each server can be unique, with their own features (based on Lua API interface, scripts, callbacks) and game mechanics changes.

 

How i can help with that idea:

I am expirienced coder. C#, C++ & SDL, OpenGL/OpenAL, and etc. And have a free time & interest for make that really nice game better!

 

 

Kind Regards!

 

 

 

Link to comment
Share on other sites

4 answers to this suggestion

Recommended Posts

  • 0
  • Boxelware Team

Hey there!

 

1) Try to remake players, galaxy, other, world database and etc - to MySQL. Only static data should be in XML or json.

 

This would be a huge load of work to do - I already have a database system, which is extendable, works fast and can be easily used by players without having mysql installed.

The factions data is XML for now. The intent behind that was that I could easily edit and check the data, for testing. This will change in the future at some point.

 

2) Some advanced systems on LUA for server-side. (and for modding) just for example:

 

The game is already using lua - if you haven't already discovered that. The integration lacks still and there is no documentation yet, but for example sector generation and stations are made with lua.

 

1) MMO features for client-side. So, they should connect to some server. Maybe a Global Server List, where list of all servers (official) already hosted. Player select it ---> Some Window with Login/Registration on current server ---> Enjoy to play! hehe.

 

These MMO features are not that simple. I would need a central server, and this server would have to be adminstrated. That costs money and time, and currently I don't have a lot of either I'm afraid :/

 

I don't have the resources to create a real MMO, with a list of public servers etc. Those have to be paid for and they have to be administrated by someone, too.

 

When I started making the game, I had a game in mind that could be easily played together with friends, inspired by the minecraft multiplayer, not an MMO. What can be done now, is playing with more people, but I think the servers might not be able to handle more than 100 logged in players at once.

 

For now, at least, I plan to do some restructuring to hopefully allow more players, but for a real MMO the game server has to be run on multiple machines, for which it is simply not made. It can surely be modified to work like this, I do have experience writing programs for cluster architectures, but this is not something that is going to happen any time soon.

 

After the next update there will be a significant server update to make the servers a lot more administrable, you can then create groups of moderators or administrators and have different commands to kick players etc.

 

If you're interested in modding and scripting, you could tell me what you would have in mind, and I would be happy to provide a corresponding API for that.

Link to comment
Share on other sites

  • 0

"If you're interested in modding and scripting, you could tell me what you would have in mind, and I would be happy to provide a corresponding API for that."

For example, is very useful for create difference types of Mods or something else - Storages.

 

-- for scripting --

doSetPilotStorage(pilotID, storage, value) --set the storage value

getPilotStorage(pilotID, storage) -- return value of storage

 

--[[
that functions will be very useful in many scripts as some trigger.
Like (just for example):
--some script, with setting trigger, when player has been attacked by `alien ship`
local key = 2500
local jammer = getPilotStorage(pilot, key)
function callbackPlayerJump()
if(jammer ~= 0) then
sendPlayerMessage("You cannot leave this sector!"..Allien_Ship.. "Jamming you warp engines!")
return false - we no jump =(
end
return true - we jump!
end
]]

They should be both - int32 and str values. And here - many ways how to use it. So, generally lua API is unknown, yeah right, i am saw some functions from ex. lua scripts but i think we need more functions (here only system functions, and few like - configure damages, SY building, and a bit like that...). And maybe some callbacks like - callbackOnMineAsteroid() - if player mine asteroid ("server sided") - for example - set Time, and after that with math.random we spawn pirate ship =)

So, basically game mechanics things should be more "open" and configurable for creating mods (callbacks, actions, etc.) than in current versions.

 

Link to comment
Share on other sites

  • 0
  • Boxelware Team

I'm planning plenty of callback functions, such as for

 

- server events (like a player logging in/out, or the creation of a new AI faction or sector)

- sector events (a ship gets damaged, a ship gets destroyed, asteroids get mined, a ship entering the sector etc.)

- player events (the player's ship gets damaged or when the player collects loot or pays something) and

- AI events (creation of an AI faction, an AI ship gets damaged etc.)

 

Those are only a small fraction of the callbacks I'm planning to integrate into the Lua API.

The lua scripts will be able to acquire variable slots from the server (has to be done via server in order to being able to save those in the server database).

 

I guess this is what you had in mind?

Link to comment
Share on other sites

  • 0

Yeah, that it is. All of that will be very useful for create mods!

Update: ++ My little suggestion - Current Galaxy folder as Lua Function. Little intro, why it needed: As you know, mods - not a only static data enchancements, sometimes - dynamic can be used too, for store user data. There should be something like game.getCurrentLoadedWorld() - and that return current(selected from saved) Galaxy folder location. For example, i am create some mod, where i am write some data to .txt file, like that:

 

local userDatafile = "awesomemod.txt"
function load_mod_data(file) --load data from file
    local t = {} ; 
    for m in io.lines(file) do
        local a, b, c = m:match '(%S+)%s+(%S+)%s+(%S+)' ; 
        table.insert(t, { data1 = a, data2 =b, data3 = c}) ; 
    end ; return t ; 
end ; 

function save_mod_data(file, text) --save data to file.
    local f = io.open(file,"w") ; f:write(text) ; f:close() ; 
end ; 
.
.
.
data = load_mod_data(userDatafile)
.
.

 

If we difine a some single file.txt in lua scipts location - they will works like a charm, but only for one galaxy... But what if we have a few galaxies? Soo, API needs a somethig for it, like a function for provide a current loaded world folder for lua scripts. That is strongly req. for operate user data from mods scripts.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...