Jump to content

MMODeveloper

Registered
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

MMODeveloper's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. I know this is old BUT just wanted to put in here that this package is great IF all you want is to have the birds as an atmospheric effect up in the sky where no one can touch them. But if you want people to be able to attack the birds or interact with them at all you would need them to be controlled on the server.
  2. If I get back into Atavism I'll update it for the latest version of UniStorm and release a compiled plugin for you guys.
  3. I was the one who was creating the UniStorm Plugin. I have posted several times on these forum my Plugin Code for getting UniStorm to work across the network.
  4. Then you need to create a Atavism Server side Plugin to control the Day/Night Cycle and weather selection and then sync it all with all players. I have a plugin that I created for it and it worked on the version of Atavism I was using at the time but I have no idea if it would work on the latest version of Atavism. It should though.
  5. I haven't tested it since I don't use Atavism any more because of how broken it is and the fact that there are so few updates BUT how I set up UniStorm is I don't even use the Auto Player Setup feature. I just go into one of the Demo Scenes for it,. Make the entire UnIStorm set up including the FPS character into a Prefab. Go into my Atavism scene drag the UniStorm Prefab I created into the scene. And then set up my character manually based on the First Person Character that came with the demo.
  6. You will need the Server side Plugin code which everyone should now have access to. You will need to create a whole new Plugin in your server project and set it up to load with the server. Here is my full EnvironmentPlugin class. package MMOI.agis.plugins; import java.io.Serializable; import java.sql.Time; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.Random; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Lock; import com.sun.javafx.collections.MappingChange.Map; import com.sun.xml.internal.bind.v2.schemagen.xmlschema.List; import atavism.msgsys.Message; import atavism.msgsys.MessageTypeFilter; import atavism.server.engine.*; import atavism.server.plugins.WorldManagerClient; import atavism.server.plugins.WorldManagerClient.ExtensionMessage; import atavism.server.plugins.WorldManagerClient.TargetedExtensionMessage; import atavism.server.util.LockFactory; import atavism.server.util.Log; import atavism.server.util.Logger; public class EnvironmentPlugin extends EnginePlugin { public static int CYCLE_SPEED = 7200; public EnvironmentPlugin(){ super(ENVIRONMENT_PLUGIN_NAME); setPluginType("Environment"); } public static String ENVIRONMENT_PLUGIN_NAME = "EnvironmentPlugin"; //protected static final Logger log = new Logger("EnvironmentPlugin"); protected static Lock lock = LockFactory.makeLock("EnvironmentPlugin"); public String getName() { return ENVIRONMENT_PLUGIN_NAME; } public void onActivate(){ seconds = 3600; Calendar cal = Calendar.getInstance(); Month = 1; Day = 1; Year = 1000; registerHooks(); } protected void registerHooks(){ getHookManager().addHook(WorldManagerClient.MSG_TYPE_SPAWNED, new SpawnedHook()); MessageTypeFilter filter = new MessageTypeFilter(); filter.addType(WorldManagerClient.MSG_TYPE_SPAWNED); Engine.getAgent().createSubscription(filter, this); Engine.getExecutor().scheduleAtFixedRate(envTick, 0, 1, TimeUnit.SECONDS); Engine.getExecutor().scheduleAtFixedRate(envSync, 0, 5, TimeUnit.SECONDS); Engine.getExecutor().scheduleAtFixedRate(changeWeather, 0, 15, TimeUnit.MINUTES); Log.debug("EnvironmentPlugin.onActivate() completed"); } class SpawnedHook implements Hook { @Override public boolean processMessage(Message msg, int arg1) { // TODO Auto-generated method stub WorldManagerClient.SpawnedMessage spawnedMsg = (WorldManagerClient.SpawnedMessage) msg; OID objOid = spawnedMsg.getSubject(); if(!Oids.contains(objOid)) Oids.add(objOid); HashMap props = new HashMap(); props.put("ext_msg_subtype", "Env.Sync"); props.put("startTime", startTime); props.put("year", Year); props.put("month", Month); props.put("day", Day); props.put("weather", weather); props.put("cycle_speed", CYCLE_SPEED); props.put("temp", Temperature); TargetedExtensionMessage _msg = new TargetedExtensionMessage(WorldManagerClient.MSG_TYPE_EXTENSION, objOid, objOid, false, props); Engine.getAgent().sendBroadcast(_msg); return true; } } ArrayList Oids = new ArrayList(); float Hour; float startTime; float dayLengthHour = 6; float nightLengthHour = 18; float dayLength = 10; float nightLength = 10; float Milisecond = 1; float SECOND = 1; float MINUTE = SECOND * 60; float HOUR = MINUTE * 60; float DAY = HOUR * 24; float seconds = 1; int Month; int Day; int Year; int weather = 8; float Temperature = 0f; int GetRandom(int minimum, int maximum){ return minimum + (int)(Math.random() * maximum); } class EnvironmentTick implements Runnable{ @Override public void run() { seconds = seconds + 1; if(startTime >= 1) { seconds = 0; Day++; if(Day > 30) { Day = 0; Month++; if(Month > 12) { Month = 1; Year++; } } } startTime = (seconds / CYCLE_SPEED); } } class EnvironmentSync implements Runnable{ @Override public void run() { for (int i = 0; i < Oids.size(); i++) { OID objOid = Oids.get(i); HashMap props = new HashMap(); props.put("ext_msg_subtype", "Env.Sync"); props.put("startTime", startTime); props.put("year", Year); props.put("month", Month); props.put("day", Day); props.put("weather", weather); props.put("cycle_speed", CYCLE_SPEED); props.put("temp", Temperature); TargetedExtensionMessage _msg = new TargetedExtensionMessage(WorldManagerClient.MSG_TYPE_EXTENSION, objOid, objOid, false, props); Engine.getAgent().sendBroadcast(_msg); } } } class GetDate implements Runnable{ @Override public void run() { Calendar cal = Calendar.getInstance(); // TODO Auto-generated method stub Month = cal.get(Calendar.MONTH) + 1; Day = cal.get(Calendar.DAY_OF_MONTH); Year = cal.get(Calendar.YEAR); } } void BroadcastWeatherEvent(){ for (int i = 0; i < Oids.size(); i++) { OID objOid = Oids.get(i); HashMap props = new HashMap(); props.put("ext_msg_subtype", "Env.WeatherGenerated"); props.put("weather", weather); TargetedExtensionMessage _msg = new TargetedExtensionMessage(WorldManagerClient.MSG_TYPE_EXTENSION, objOid, objOid, false, props); Engine.getAgent().sendBroadcast(_msg); } } int forceWeatherChange = 0; enum Seasons{ Winter, Spring, Summer, Fall } Seasons season = Seasons.Winter; class ChangeWeather implements Runnable{ @Override public void run() { // TODO Auto-generated method stub int percent = GetRandom(0, 100); int advance = 0; if(Month == 1 || Month == 2 || Month == 3 || Month == 11 || Month == 12) { season = Seasons.Winter; Temperature = 32; if(percent <= 45 || forceWeatherChange >= 4){ if(weather == 1) { advance = GetRandom(0, 100); if(advance <= 50) weather = 2; else weather = 7; } else if(weather == 2) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = 7; } else if(weather == 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = 7; } else if(weather > 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 1; else weather = 7; } BroadcastWeatherEvent(); forceWeatherChange = 0; return; } } else if(Month == 4 || Month == 5) { season = Seasons.Spring; Temperature = 60; if(percent <= 90 || forceWeatherChange >= 4){ if(weather == 1) { advance = GetRandom(0, 100); if(advance <= 50) weather = 2; else weather = GetRandom(4, 6); } else if(weather == 2) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = GetRandom(4, 6); } else if(weather == 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = GetRandom(4, 6); } else if(weather > 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 1; else weather = GetRandom(4, 6); } BroadcastWeatherEvent(); forceWeatherChange = 0; return; } } else if(Month == 6 || Month == 7 || Month == 8) { season = Seasons.Summer; Temperature = 90; if(percent <= 75 || forceWeatherChange >= 4){ if(weather == 1) { advance = GetRandom(0, 100); if(advance <= 50) weather = 2; else weather = GetRandom(4, 6); } else if(weather == 2) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = GetRandom(4, 6); } else if(weather == 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = GetRandom(4, 6); } else if(weather > 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 1; else weather = GetRandom(4, 6); } BroadcastWeatherEvent(); forceWeatherChange = 0; return; } } else if(Month == 9 || Month == 10) { season = Seasons.Fall; Temperature = 50; if(percent <= 40 || forceWeatherChange >= 4){ if(weather == 1) { advance = GetRandom(0, 100); if(advance <= 50) weather = 2; else weather = GetRandom(4, 6); } else if(weather == 2) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = GetRandom(4, 6); } else if(weather == 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = GetRandom(4, 6); } else if(weather > 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 1; else weather = GetRandom(4, 6); } BroadcastWeatherEvent(); forceWeatherChange = 0; return; } } forceWeatherChange++; } } // Environment Tick: Advances the Day/Night Cycles and the Calendar. EnvironmentTick envTick = new EnvironmentTick(); // Environment Sync: Used for syncing the Cycle with the clients EnvironmentSync envSync = new EnvironmentSync(); // Change Weather: Responsible for Generating Weather ChangeWeather changeWeather = new ChangeWeather(); } On Client Side I made the UniStorm class a singleton so I could access it from anywhere (Looking at my code I guess this version of it I didn't but usually I do and I would recommend it!). Then I created a EnvironmentHandler class which handles receiving the messages from the server and syncing UniStorm. using UnityEngine; using System.Collections; using System.Collections.Generic; public class EnvironmentHandler : MonoBehaviour { // Use this for initialization void Start () { NetworkAPI.RegisterExtensionMessageHandler("Env.Sync", HandleSync); NetworkAPI.RegisterExtensionMessageHandler("Env.WeatherGenerated", this.HandleWeatherGenerated); } // Update is called once per frame void Update () { } void HandleSync(Dictionary props) { float startTime = (float)props["startTime"]; int year = (int)props["year"]; int month = (int)props["month"]; int day = (int)props["day"]; int weather = (int)props["weather"]; int cycle_speed = (int)props["cycle_speed"]; float temp = (float)props["temp"]; StartCoroutine(DoSync(startTime, year, month, day, weather, cycle_speed, temp)); } void HandleWeatherGenerated(Dictionary props) { int weather = (int)props["weather"]; UniStormWeatherSystem_C uniStorm = GameObject.FindObjectOfType(); if (uniStorm != null) { uniStorm.weatherForecaster = weather; //Debug.LogError("Generated Weather: " + weather.ToString()); } else { //Debug.LogError("UNISTORM not found!"); } } IEnumerator DoSync(float startTime, int year, int month, int day, int weather, int speed, float temp) { yield return new WaitForSeconds(0.1f); UniStormWeatherSystem_C uniStorm = GameObject.FindObjectOfType(); if(uniStorm != null) { uniStorm.startTime = startTime; uniStorm.yearCounter = year; uniStorm.monthCounter = month; uniStorm.dayCounter = day; uniStorm.weatherForecaster = weather; UniStormWeatherSystem_C.CYCLE_SPEED = speed; uniStorm.temperature = (int)temp; } else { //Debug.LogError("UNISTORM not found!"); } } } I made a generic script which has the gameobject it's attached to follow the player so then I could attach it to the UniStorm base object and it will follow the player around. Something like is only needed for larger seamless worlds. If you have smaller zones then depending on the size of your zones you shouldn't have any issue just centering UniStorm on your zone. For this script all I did was get the Object's Transform and the Player's Transform and set the Object's transform position to that of the player's transform position every frame. Or you could even put it inside a repeated invoke method and invoke it every few seconds though I haven't tested it to see if the jump would be noticeable. How I have everything else set up I'm honestly not sure. It's been a while. I've upgraded to the latest version of Unity and so I've been unable to do anything with Atavism since. Andrew just posted a fix but I believe it's for the latest test release of Atavism 2.7 which until the known bugs are dealt with I'm not willing to upgrade to it yet. With the latest stable version of Atavism there is all kinds of issues with UMA with the latest release of Unity.
  7. class ChangeWeather implements Runnable{ @Override public void run() { // TODO Auto-generated method stub int percent = GetRandom(0, 100); if(Month == 12) { if(percent <= 25 || forceWeatherChange >= 4){ weather = GetRandom(1, 11); BroadcastWeatherEvent(); forceWeatherChange = 0; return; } } forceWeatherChange++; } } That code right there generates the weather. You would have to finish filling it out for every month as at the moment it only handles December. With that you can give each month it's own percentage chance of changing weather. Here is the actual code I am using which handles all months grouped in seasons. Each month has it's own chances of storms and storms progress in natural fashion from cloudy to foggy to light precip to heavier precip and at any stage there is a chance it clears up and never advances any further. It creates a very realistic weather system. class ChangeWeather implements Runnable{ @Override public void run() { // TODO Auto-generated method stub int percent = GetRandom(0, 100); int advance = 0; if(Month == 1 || Month == 2 || Month == 3 || Month == 11 || Month == 12) { season = Seasons.Winter; Temperature = 32; if(percent <= 45 || forceWeatherChange >= 4){ if(weather == 1) { advance = GetRandom(0, 100); if(advance <= 50) weather = 2; else weather = 7; } else if(weather == 2) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = 7; } else if(weather == 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = 7; } else if(weather > 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 1; else weather = 7; } BroadcastWeatherEvent(); forceWeatherChange = 0; return; } } else if(Month == 4 || Month == 5) { season = Seasons.Spring; Temperature = 60; if(percent <= 90 || forceWeatherChange >= 4){ if(weather == 1) { advance = GetRandom(0, 100); if(advance <= 50) weather = 2; else weather = GetRandom(4, 6); } else if(weather == 2) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = GetRandom(4, 6); } else if(weather == 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = GetRandom(4, 6); } else if(weather > 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 1; else weather = GetRandom(4, 6); } BroadcastWeatherEvent(); forceWeatherChange = 0; return; } } else if(Month == 6 || Month == 7 || Month == 8) { season = Seasons.Summer; Temperature = 90; if(percent <= 75 || forceWeatherChange >= 4){ if(weather == 1) { advance = GetRandom(0, 100); if(advance <= 50) weather = 2; else weather = GetRandom(4, 6); } else if(weather == 2) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = GetRandom(4, 6); } else if(weather == 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = GetRandom(4, 6); } else if(weather > 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 1; else weather = GetRandom(4, 6); } BroadcastWeatherEvent(); forceWeatherChange = 0; return; } } else if(Month == 9 || Month == 10) { season = Seasons.Fall; Temperature = 50; if(percent <= 40 || forceWeatherChange >= 4){ if(weather == 1) { advance = GetRandom(0, 100); if(advance <= 50) weather = 2; else weather = GetRandom(4, 6); } else if(weather == 2) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = GetRandom(4, 6); } else if(weather == 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 3; else weather = GetRandom(4, 6); } else if(weather > 3) { advance = GetRandom(0, 100); if(advance <= 50) weather = 1; else weather = GetRandom(4, 6); } BroadcastWeatherEvent(); forceWeatherChange = 0; return; } } forceWeatherChange++; } }
  8. With my Setup The Server generates the Random Weather and syncs all the Clients.
  9. The Code I posted is Server side and should work for any version of UniStorm. You may just have to make some changes to UniStorm such as remove the code in UniStorm for deciding the weather and things like that.
  10. It will never happen. Atavism IS the the networking solution. The plugins are a added bonus to help kickstart your game. EVERY part of the plugins would have to be rewritten to support SpatialOS and even recoded in a different language since everything server side is in Java.
  11. How difficult would it be to add in a few improvements to the Item System and Resource Gathering Systems? First Items: - Add in Slots to weapons and armor where players could add Magical Gems or similar mechanic to improve stats, give the weapon/armor magical properties, ect. - Add in Quality. The higher your skill is at say blacksmith or weapon smith or whatever skill is required for making the item the higher the quality of the item and the more damage, stats, or durability the item has. - Durability (Pretty self explanatory) - Add in material level, for example a Stone pickaxe would have a resource level of Stone while a wood pickaxe would have a Resource Level of Wood... Resource Gathering: - Require a tool with at least a certain resource level... So stone for example could be gathered with a pickaxe with a Resource level of Wood or greater while Iron would require a pickaxe with a Resource level of at least Stone. - Require a tool with a certain Quality level of the base Resource level... So Iron might only be able to be gathered with a Pickaxe of Stone Resource Level and at least 50 Quality But could be gathered with a Pickaxe of Iron Resource Level and of any quality. Crafting: - Add optional Materials that if the player included when crafting the item it would improve the quality of the item, add in slots to the item, give the item additional stats, ect.
  12. VoxelFarm is a complete Voxel Engine. Not just a voxel World Creator... It comes with Voxel Physics and everything. Only thing it was lacking last I knew though they may have added in before the deal with EQ:Next fell through was Voxel Water physics. It has a really cool scripting language for creating buildings and stuff. We actually licensed it... Come to find out though it was only for Unity 5 and at the time Atavism hadn't been upgraded to Unity 5 yet and it was PC only so we ended up getting a refund for it.
  13. Have you looked at VoxelFarm at all? I haven't seen much out of them since the whole deal with EQ:Next fell through.
  14. I have the Developer of Terrain Engine on Skype. I was actually looking at TerrainEngine for Greed Monger several years ago but the price tag then was WAY out of our range so we got on board with AtVoxel at that time... When I get a chance I can try to contact him and see what would be involved with getting TerrainEngine integrated into Atavism.
  15. I've been working on a Cube based Voxel Engine... Got "Infinite" (Limited only by Hard Drive space and the Physics Engine) Terrain being generated in 16x16x16 chunks. in the Y direction it creates 8 chunks from -4 to 4 currently. Got a Visual Node based Editor working for creating Terrain Generators. It takes full advantage of LibNoise and I've created some custom Generators for Heightmap support though it's still a work in progress. The Entire Engine is multithreaded taking advantage of a Thread Pool. Would anyone be interested in me releasing the Voxel Engine as well as a Atavism Plugin in order to interact with the Voxel Engine over the network (Out side of the Claim System if at all possible)?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.