Mod/patch wip DIMENSION API
- InfinityProject
- Member
- Posts: 1009
- Joined: Sat Mar 17, 2012 00:52
- Location: World of Infinity, US
Mod/patch wip DIMENSION API
Alright guys! Well I decided to learn c++. I have a skilled programmer teaching me how to code. But here's my first project!
Basically through a lua file, you can register your own dimension. The dimension files are coded in c++ and are accessed through lua. You will be able to define everything from the terrain to the portal that takes you there. Going through the portal takes you to a loading screen where you will then go to your dimension.
Progress:
2 terrains are coded, flat and mountainous.
The loading screen with the portals works.
You can define what blocks make up the terrain.
To do:
Add definable mobs
More terrains
Define sky texture in the dimension
This is going to take a lot of work and time but I will get it done!
Basically through a lua file, you can register your own dimension. The dimension files are coded in c++ and are accessed through lua. You will be able to define everything from the terrain to the portal that takes you there. Going through the portal takes you to a loading screen where you will then go to your dimension.
Progress:
2 terrains are coded, flat and mountainous.
The loading screen with the portals works.
You can define what blocks make up the terrain.
To do:
Add definable mobs
More terrains
Define sky texture in the dimension
This is going to take a lot of work and time but I will get it done!
- InfinityProject
- Member
- Posts: 1009
- Joined: Sat Mar 17, 2012 00:52
- Location: World of Infinity, US
That could be cool for a lot of things then. Assuming a computer with a lot of RAM, you could have a dimension for a world that emulates each version of Minetest, or a dimension for different styles of mapgen, such as a flat world, a cave world, a regular world, et cetera. Each should have its own map_meta.txt.InfinityProject wrote:It's own.
- InfinityProject
- Member
- Posts: 1009
- Joined: Sat Mar 17, 2012 00:52
- Location: World of Infinity, US
- InfinityProject
- Member
- Posts: 1009
- Joined: Sat Mar 17, 2012 00:52
- Location: World of Infinity, US
-
- Member
- Posts: 647
- Joined: Thu Feb 21, 2013 23:54
Hmm. Just a possibility to keep things relatively simple:
- Make a mod that saves and loads inventory to/from a world-neutral directory (which could be a network share, BTW).
- Run one server per world in the "dimension set".
- Add an API call that tells the client what server to switch to. For security (so the users always have an idea of where they are really connecting) you'd probably want to limit the list somehow, like only choosing servers on the same externally visible host name/address or on first connect having the client request from the server a list of "real" peer "dimension servers".
Last edited by prestidigitator on Sat Apr 06, 2013 09:12, edited 1 time in total.
You'd think that saving the inventory externally when the player leaves and loading it when the player joins would be enough. However, a player could start up two instances of the client, and load the inventory in both dimensions, then put the same inventory into chests in both worlds, thus cloning the items. To prevent this (assuming we can't have the server instances share the inventory information directly), you'd need to also keep a list of logged in users outside the game that all worlds can check when a user logs in. If they are already logged in in another world, kick them from one of the two. You'd also need to find a way to keep auth.txt synchronized between all worlds.prestidigitator wrote:Hmm. Just a possibility to keep things relatively simple:
seems like that might allow the same kind of "immersion" without changing too much in terms of the game architecture.
- Make a mod that saves and loads inventory to/from a world-neutral directory (which could be a network share, BTW).
- Run one server per world in the "dimension set".
- Add an API call that tells the client what server to switch to. For security (so the users always have an idea of where they are really connecting) you'd probably want to limit the list somehow, like only choosing servers on the same externally visible host name/address or on first connect having the client request from the server a list of "real" peer "dimension servers".
There are probably other difficulties we'd need to deal with, but those are the things that come to mind.
- Likwid H-Craft
- Member
- Posts: 1113
- Joined: Sun Jan 06, 2013 14:20
- Location: Lost in Crypt
-
- Member
- Posts: 647
- Joined: Thu Feb 21, 2013 23:54
If you're that worried about cheating, sure. If you just want to create the illusion of being able to hop between worlds/dimensions, it seems like a nice jumping off point. An intermediate measure might be to empty the player's inventory as you save it to the file, and use an OS-level file lock to make sure only one server saves to the file at one time. Relatively foolproof, but probably not hack-proof.0gb.us wrote:You'd think that saving the inventory externally when the player leaves and loading it when the player joins would be enough. However, a player could start up two instances of the client... There are probably other difficulties we'd need to deal with, but those are the things that come to mind.
Who is online
Users browsing this forum: Google [Bot] and 39 guests