About Store Forum Documentation Contact
Donations:
289$/mo



Post Reply 
Ineisis -Detailed tutorials
Author Message
Palaxe Offline
Member

Post: #31
RE: Ineisis -Detailed tutorials
So I have the right World in Constants,

const COMPRESS_TYPE COMPRESSION_TYPE =COMPRESS_ZLIB;
const uint COMPRESSION_LEVEL=9;

const int Areas=6, AreaSize=64, HmRes=32, BlocksDim=64, BlocksBorder=2, ViewRange=1000,
AreaUpdateDist=32; // distance in meters after which transfer areas from server to client
const flt HeightmapScale=1.0; //1.0/8;

const flt MagicBoltSpeed=20, MagicBoltMana=5;

const flt HealthPerSecond=1, ManaPerSecond=1.8;

const flt TimeSpeed=320;

const UID MainWorldID(123, 456, 789, 123);
const UID Editorworld = (UID(1935355564, 1275237476, 2392722111, 1735981628));

const Str Storage="Storage" , // Folder where all data will be stored (worlds/characters)
BinPath="Bin/" , // path where all data files will be downloaded
DataPak=BinPath+"Data.pak"; // pak path to which data files will be archived
/******************************************************************************/
const RectI WorldBoundsAreas (-Areas, -Areas, Areas-1, Areas-1),
WorldBoundsHeightmap( WorldBoundsAreas.min.x *HmRes , WorldBoundsAreas.min.y *HmRes ,
(WorldBoundsAreas.max.x+1)*HmRes , (WorldBoundsAreas.max.y+1)*HmRes );
const BoxI WorldBoundsBlocks (VecI( WorldBoundsAreas.min.x *AreaSize , -32, WorldBoundsAreas.min.y *AreaSize ),
VecI((WorldBoundsAreas.max.x+1)*AreaSize-1, 256, (WorldBoundsAreas.max.y+1)*AreaSize-1));
const Box WorldBounds (Vec ( WorldBoundsAreas.min.x *AreaSize , -32, WorldBound
(This post was last modified: 08-16-2013 12:09 AM by Palaxe.)
08-16-2013 12:02 AM
Find all posts by this user Quote this message in a reply
Ozmodian Offline
Member

Post: #32
RE: Ineisis -Detailed tutorials
In your code you have EditorWorldID and in constants you have Editorworld
08-16-2013 12:47 AM
Find all posts by this user Quote this message in a reply
Palaxe Offline
Member

Post: #33
RE: Ineisis -Detailed tutorials
(08-16-2013 12:47 AM)Ozmodian Wrote:  In your code you have EditorWorldID and in constants you have Editorworld

Sweet! So then I found the other errors such as LoadWorldFromMain
And other adjustments. But I see now how everything ties into one another.

So It runs great. I might redo this lesson again since I was having problems with it. LOL...

I'm also excited that your going to give us another video with water.

Thanks for helping everyone out with your Tuts... You Rock!
08-16-2013 02:16 AM
Find all posts by this user Quote this message in a reply
Palaxe Offline
Member

Post: #34
RE: Ineisis -Detailed tutorials
Hey one more question.
So as I start the server now that I have this new code in it I get an error when the server starts up and it says. Attempting to create an actor without creating Physics first.

I take that as one of my models does not have the physics done up on him.

The part that puzzles me is before I put in the change of code I never had this error. Is there something in the code that looks something to trigger the error now?
(This post was last modified: 08-16-2013 03:43 AM by Palaxe.)
08-16-2013 03:37 AM
Find all posts by this user Quote this message in a reply
Ozmodian Offline
Member

Post: #35
RE: Ineisis -Detailed tutorials
You need to add the following line to Main.Init()

Code:
Physics.create(EE_PHYSX_DLL_PATH, CSS_FREEZE_XZ).timestep(PHYS_TIMESTEP_VARIABLE);

I put is just after

Code:
ParticlesCache.mode(CACHE_DUMMY_NULL);
08-16-2013 03:50 AM
Find all posts by this user Quote this message in a reply
Palaxe Offline
Member

Post: #36
RE: Ineisis -Detailed tutorials
(08-16-2013 03:50 AM)Ozmodian Wrote:  You need to add the following line to Main.Init()

Code:
Physics.create(EE_PHYSX_DLL_PATH, CSS_FREEZE_XZ).timestep(PHYS_TIMESTEP_VARIABLE);

I put is just after

Code:
ParticlesCache.mode(CACHE_DUMMY_NULL);

Oh Wow, Worked like a charm.
So did it tell the phys x stuff to not cache?
just wondering. Thanks smile
08-16-2013 05:27 AM
Find all posts by this user Quote this message in a reply
Ozmodian Offline
Member

Post: #37
RE: Ineisis -Detailed tutorials
Hi All,

Posted my next video on Water/Materials/Grass. Hope it is helpful. Feedback is always appreciated:

Water/Materials/Grass (15-AUG-13) (26min 24sec)
http://www.youtube.com/watch?v=CfPyWxJsO...e=youtu.be


What is covered this time?
-Simple Grass/Materials
-How water is saved from the Editor
-Implementing water by creating new server data type
-Adding water to world message

**Edit** added a text file with the main code changes for reference**


Attached File(s)
.txt  Code.txt (Size: 7.67 KB / Downloads: 87)
(This post was last modified: 08-16-2013 03:16 PM by Ozmodian.)
08-16-2013 05:56 AM
Find all posts by this user Quote this message in a reply
Palaxe Offline
Member

Post: #38
RE: Ineisis -Detailed tutorials
Sweet! I can't wait to get off work to check this out smile
Thanks so much!
08-16-2013 04:47 PM
Find all posts by this user Quote this message in a reply
Jben Offline
Member

Post: #39
RE: Ineisis -Detailed tutorials
Thanks smile
10-11-2014 11:59 PM
Visit this user's website Find all posts by this user Quote this message in a reply
zeph2 Offline
Member

Post: #40
RE: Ineisis -Detailed tutorials
I followed the tutorial videos on the Heightmap.It works, but the Heightmap doesnt look as it does in EE when loaded...

1)There are sections missing where the terrain is flat as in the default where it should be heightmap, and there are sections that are too high with gaps of space in between that do not connect with the rest of the land.. Any Ideas whats wrong?

2)Any Idea on how to get rid of the bounding box ie the invisible walls, or make them larger at least. I edited all the diff const values in Shared/constants but non of them seem to make the world box larger. Id like to have open world real terrain..
(This post was last modified: 12-16-2014 06:45 AM by zeph2.)
12-16-2014 06:41 AM
Find all posts by this user Quote this message in a reply
A_Gris Offline
Member

Post: #41
RE: Ineisis -Detailed tutorials
hey im bumping this, in case of someone knowing;

the tutorial with the object to import from the mapeditor to inesis is not working anymore ( outdated )

game.objmemx has been replaced by game.objmap, but its not working, maybe someone knows what i am doing wrong ?

Code:
Game.ObjMap  <Game.Static> Items ;
   Game.World.setObjType(Items, OBJ_STATIC)
            
        if(Items.elms())
            {
               REPA(Items)
               {
                  VecI local(Items[i].pos().x, Items[i].pos().y, Items[i].pos().z);
                  SetObj(&world, local,  Items[i].matrix().angle(), Items[i].base.id());              
               }
            }
              
      }

thanks !

as for you, zeph, the problem i believe is in your resolution; my field is working fine, as for the box, its "const int Areas=x" in constant to change, if i remember correctly you only have to change this, as for the invisible wall, its a protection to avoid falling off the map, so idk in which case youll want to get ride of it ? falling off the map and seeing if from under it doesnt sounds nice =p

A_Gris
(This post was last modified: 12-31-2014 02:24 AM by A_Gris.)
12-31-2014 02:12 AM
Find all posts by this user Quote this message in a reply
JRizzle Offline
Member

Post: #42
RE: Ineisis -Detailed tutorials
To answer you A_Gris and all future people interested in getting static objects paired with dynamic world working in Ineisis Online. Ozmodian does an awesome job at explaining the solution to this and I want to thank him for taking the time to do so.

There are a few things that had to be revised to get this working for me and I want to share with everyone.

First things first. Game.ObjMemx -> Game.ObjMap

Secondly, I want to point out the 2 main differences it made for it to work.

*Adding*
Code:
Physics.create(EE_PHYSX_DLL_PATH, CSS_FREEZE_XZ).timestep(PHYS_TIMESTEP_VARIABLE);

directly after
Code:
ParticlesCache.mode(CACHE_DUMMY_NULL);

inside of Ineisis Server/Main.cpp

*Changing*
Code:
areastates.New().set(a, Game.AREA_LOAD);
to
Code:
areastates.New().set(a, Game.AREA_INACTIVE);


Ineisis Server/Load Static.cpp
Code:
class CustomStatic : Game :: Static
{
   Game.ObjParams obj;
  
   void create(Game.ObjParams &obj)
   {
      super.create(obj);
      T.obj = obj;
   }
  
   C UID get_ID()
   {
      if (&obj)
         return obj.base().id();
      return UIDZero;
   }
  
   ~CustomStatic()
   {
      obj.del();
   }
   CustomStatic(){};
  
}


Ineisis Server/World.cpp
Code:
void LoadEditorWorld(C UID &world_id)
{
   Net.World &world = *Net.Worlds(world_id);
   Game.ObjMap<CustomStatic> Items;
   Game.ObjMap<CustomStatic> iTrees;
   Game.World.mode(Game.WORLD_MANUAL);
   Game.World.setObjType(Items, OBJ_STATIC)
             .setObjType(iTrees, OBJ_TREE)
             .New(EditorWorld);
   int areas = Areas + 1;
   for(int x=-areas; x<areas; x++)
      for(int y=-areas; y<areas; y++)
      {
         VecI2 a(x, y);
         Memc<Game.WorldManager.AreaState> areastates;
         areastates.New().set(a, Game.AREA_INACTIVE);
         Game.World.areaSetState(areastates, true); // setting true will unload all other areas, no wasted memory.
         Game.Area *the_area = Game.World.areaLoaded(a);
         Area *data = GetArea(world, VecI2(x, y));
         Image &temp_image = the_area.getData().height;
         RectI ah = RectI(VecI2(0, 0), VecI2(HmRes+1, HmRes+1)); // area heightmap
         for(int hy=ah.min.y; hy<=ah.max.y; hy++) // iterate area heightmap
            for(int hx=ah.min.x; hx<=ah.max.x; hx++)
               data.heightmap.setHeight(hx, hy, (the_area.data().height.pixelFLinear(hx, hy)+128)); // set the custom HM to be equal to the value of the Editor HM
              
         if(Items.elms())
         {
            REPA(Items)
            {
               VecI local(Items[i].pos().x, Items[i].pos().y, Items[i].pos().z);
               SetObj(&world, local, Items[i].matrix().angle(), Items[i].get_ID());
            }
         }
         if(iTrees.elms())
         {
            REPA(iTrees)
            {
               VecI local(iTrees[i].pos().x, iTrees[i].pos().y, iTrees[i].pos().z);
               SetGroundObj(&world, local, iTrees[i].matrix().angle(), iTrees[i].get_ID());
            }
         }
      }
    Game.World.del(); // **If needed for objects, remove this*** Delete it after loading since it is no longer needed
}


Ineisis Server/World.cpp
Code:
void InitWorld()
{
   Net.Worlds.replaceClass<World>();
   SetWorldAreas();
   LoadWorld(MainWorldID);
   LoadEditorWorld(MainWorldID);
}

Shared/Constants.cpp - Insert after MainWorldID
Code:
const UID EditorWorld = UID(2821025862, 1169992174, 276167868, 3494657711);

100% working as of today with all up-to-date sources
Thanks and Enjoy smile
01-05-2015 03:58 AM
Find all posts by this user Quote this message in a reply
Jben Offline
Member

Post: #43
RE: Ineisis -Detailed tutorials
Thanks ! 100% Working. But How could we add weapons and potions on the map? I tried with the code (Tutorial) but the items do not appear.
01-05-2015 12:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
JRizzle Offline
Member

Post: #44
RE: Ineisis -Detailed tutorials
lindsay, with the way this is being used. Any item placed in the world editor needs to have the obj_type set correctly when we pass it to the LoadEditorWorld. So for instance if we wanted to add in a set of buckets around the world and you wanted a container for only buckets you would add in or replace to be like below:

Code:
Game.ObjMap<CustomStatic> Buckets;
Game.World.setObjType(Buckets, OBJ_STATIC);

if(Buckets.elms())
         {
            REPA(Buckets)
            {
               VecI local(Buckets[i].pos().x, Buckets[i].pos().y, Buckets[i].pos().z);
               SetObj(&world, local, Buckets[i].matrix().angle(), Buckets[i].get_ID());
            }
         }

NOTE: the obj_type of OBJ_STATIC and Create mesh must be set on the actual object when you place them in the world editor.

As far as having items to be picked up and consumed/equipped that are placed in the world editor. I would think that would need to be a different obj_type due to its properties of the obj having to be passed, etc. You may want to check out RPG2 Source in the Esenthel Store. It will be a good starting point for you to see how objects/items have properties.

However, no Net code is included in RPG2 Source.

If any of this is wrong, please correct me.
01-05-2015 03:59 PM
Find all posts by this user Quote this message in a reply
A_Gris Offline
Member

Post: #45
RE: Ineisis -Detailed tutorials
Awesome its working perfectly ! smile thanks for sharing !

(no scaling tho =p any idea how to plant that too ? wink might come handful someday maybe =o)
(This post was last modified: 01-05-2015 10:37 PM by A_Gris.)
01-05-2015 05:12 PM
Find all posts by this user Quote this message in a reply
Post Reply