Page 1 of 1

Mod/patch wip DIMENSION API

PostPosted: Mon Apr 01, 2013 22:26
by InfinityProject
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!

PostPosted: Mon Apr 01, 2013 23:25
by 0gb.us
Does each dimension have its own SQLite file, or is it all packed into one?

PostPosted: Mon Apr 01, 2013 23:26
by InfinityProject
It's own.

PostPosted: Mon Apr 01, 2013 23:32
by jojoa1997
Cant wait. maybe it could be added to minetest engine. also i ambsuspicious of an april fools joke here.

PostPosted: Mon Apr 01, 2013 23:45
by mauvebic
InfinityProject wrote:Define sky texture in the dimension


Some insight on that: i think one of the earlier versions (<=0.3) had texturable skies, perhaps the source can be helpful, Would be cool to get that back :-)

PostPosted: Mon Apr 01, 2013 23:45
by 0gb.us
InfinityProject wrote:It's own.


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.

PostPosted: Sat Apr 06, 2013 02:25
by InfinityProject
So this started out as an Aprils fool joke... But looking over source code I think ill attempt it. I am learning c++ just slowly. I may start this next week. I really think this will be a cool thing to do. I will need help.

PostPosted: Sat Apr 06, 2013 02:28
by jojoa1997
jojoa1997 wrote:Cant wait. maybe it could be added to minetest engine. also i ambsuspicious of an april fools joke here.
I WAS RIGHT

PostPosted: Sat Apr 06, 2013 02:30
by InfinityProject
Yes you were. April fools mauvebic and ogb.us! But this will be done slowly but surely.

PostPosted: Sat Apr 06, 2013 02:54
by jojoa1997
you will help me a lot with minitest end and nether

PostPosted: Sat Apr 06, 2013 04:11
by 0gb.us
InfinityProject wrote:Yes you were. April fools mauvebic and ogb.us! But this will be done slowly but surely.


No worries. I was interested in a hypothetical way, but I don't think I have the resources to run multiple dimensions on my server.

PostPosted: Sat Apr 06, 2013 09:10
by prestidigitator
Hmm. Just a possibility to keep things relatively simple:

  1. Make a mod that saves and loads inventory to/from a world-neutral directory (which could be a network share, BTW).
  2. Run one server per world in the "dimension set".
  3. 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".

seems like that might allow the same kind of "immersion" without changing too much in terms of the game architecture.

PostPosted: Sat Apr 06, 2013 10:00
by 0gb.us
prestidigitator wrote:Hmm. Just a possibility to keep things relatively simple:

  1. Make a mod that saves and loads inventory to/from a world-neutral directory (which could be a network share, BTW).
  2. Run one server per world in the "dimension set".
  3. 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".

seems like that might allow the same kind of "immersion" without changing too much in terms of the game architecture.


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.

There are probably other difficulties we'd need to deal with, but those are the things that come to mind.

PostPosted: Sat Apr 06, 2013 16:51
by Likwid H-Craft
Can you make a moon as a DIMENSION?

PostPosted: Sat Apr 06, 2013 19:18
by Calinou
Likwid H-Craft wrote:Can you make a moon as a DIMENSION?


Can't you read? This is an april fool.

PostPosted: Mon Apr 08, 2013 08:01
by prestidigitator
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.


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.

PostPosted: Mon Apr 08, 2013 08:12
by mauvebic
InfinityProject wrote:Yes you were. April fools mauvebic and ogb.us! But this will be done slowly but surely.


Honestly, I didn't think a novice could accomplish *all* that, but i didn't want to discourage anybody :P I still think textured skies aren't a bad idea :P