Discuss Scratch
- Discussion Forums
- » Things I'm Making and Creating
- » The Time Master, a MMORPG sandbox
- 2Dproductions
-
500+ posts
The Time Master, a MMORPG sandbox
Hi All,
Over the past few days I have been working on a MMORPG style sandbox game in Unity3D and would like some feedback and ideas.
Currently I have an infinite terrain engine, caves, ore, trees, block placing/breaking and a day/night cycle.
Things currently being implemented:
Things which need doing:
When you suggest an idea and IF I like it I will add your idea to the list and will try to implement it.
Over the past few days I have been working on a MMORPG style sandbox game in Unity3D and would like some feedback and ideas.
Currently I have an infinite terrain engine, caves, ore, trees, block placing/breaking and a day/night cycle.
Things currently being implemented:
- FPS Improvements
- Fluids
Things which need doing:
- Trees
- Graphics Improvements
- Multiplayer
- Ore
- Fluids
- Fancy Blocks
- Player Models and Rigging
- FPS Improvements
- Enemies
- Inventory
- ECS
- Time Slowing / Speeding Up
When you suggest an idea and IF I like it I will add your idea to the list and will try to implement it.
Current known bugs:
GIFs and Screenshots:
Block breaking, placing and terrain:
Textures:
Some amazing cover art:
Amethyst - The first ore in the game:
The sky:
- The clouds will glow at night
- The stars appear stretched
- Chunks will load and then unload at low chunk distances
- File exceptions galore
Last edited by 2Dproductions (March 27, 2019 21:45:35)
- sippingcider
-
500+ posts
The Time Master, a MMORPG sandbox
Not familiar with Unity, but assuming you can view and edit the source code here is something you could do for time speeding/slowing.
My guess is the game works off a main method that loops, it should calc the game interactions on a set interval while displaying the graphics whenever it can. The game interaction calculations is the part where you can adjust the timing, for a lot of games they will do something like 60 loops per second. You could have a variable that you can change that adjusts when these calculations are done. It might look something like this right now:
timeDelta = lastTime - timer.seconds() //more likely done in nanoseconds or milliseconds, but you can convert based on what it is now
if (timeDelta > 1/60)
{
game.tick()
}
And change it to this:
timeDelta = lastTime - timer.seconds()
if (timeDelta > (1/60) * timeVariable)
{
game.tick()
}
Set timeVariable to something < 1 for faster time, and something > 1 for slower time.
My guess is the game works off a main method that loops, it should calc the game interactions on a set interval while displaying the graphics whenever it can. The game interaction calculations is the part where you can adjust the timing, for a lot of games they will do something like 60 loops per second. You could have a variable that you can change that adjusts when these calculations are done. It might look something like this right now:
timeDelta = lastTime - timer.seconds() //more likely done in nanoseconds or milliseconds, but you can convert based on what it is now
if (timeDelta > 1/60)
{
game.tick()
}
And change it to this:
timeDelta = lastTime - timer.seconds()
if (timeDelta > (1/60) * timeVariable)
{
game.tick()
}
Set timeVariable to something < 1 for faster time, and something > 1 for slower time.
- 2Dproductions
-
500+ posts
The Time Master, a MMORPG sandbox
Not familiar with Unity, but assuming you can view and edit the source code here is something you could do for time speeding/slowing.
My guess is the game works off a main method that loops, it should calc the game interactions on a set interval while displaying the graphics whenever it can. The game interaction calculations is the part where you can adjust the timing, for a lot of games they will do something like 60 loops per second. You could have a variable that you can change that adjusts when these calculations are done. It might look something like this right now:
timeDelta = lastTime - timer.seconds() //more likely done in nanoseconds or milliseconds, but you can convert based on what it is now
if (timeDelta > 1/60)
{
game.tick()
}
And change it to this:
timeDelta = lastTime - timer.seconds()
if (timeDelta > (1/60) * timeVariable)
{
game.tick()
}
Set timeVariable to something < 1 for faster time, and something > 1 for slower time.
Unity uses it's own engine for this kind of stuff, I was thinking something like this in the player script (Player controller.cs):
public static float timeWarp = 1; private enum foo = { timeSlow, timeFast, timeStopped }; void UpdateTimeInterval(foo state) { if (state == foo.timeSlow) { timeWarp = 0.25f; } else if (state == foo.timeFast) { timeWarp = 1.75f } else { timeWarp = 0; } } void FixedUpdate() { if (Input.KeyDown(somekey)) { UpdateTimeInterval(foo.something); } }
And in entities (Entity.cs):
public Script playerScript; private float speed = 1; void Start() { speed = playerScript.timeWarp; } void FixedUpdate() { speed = playerScript.timeWarp; //Multiply animation speed and things here by speed }
Last edited by 2Dproductions (March 3, 2019 21:53:10)
- sippingcider
-
500+ posts
The Time Master, a MMORPG sandbox
Ah yes, that should work well. Might want to add a normal state to your enum as well.
- 2Dproductions
-
500+ posts
The Time Master, a MMORPG sandbox
Yep I probably will, that enum will be all the abilities of the player. Ah yes, that should work well. Might want to add a normal state to your enum as well.
- Scratch_Foxy_Rogues
-
100+ posts
The Time Master, a MMORPG sandbox
How are trees and ores going?
- sippingcider
-
500+ posts
The Time Master, a MMORPG sandbox
Going to reply to your question about flood fill for lighting here so I have more room to type.
Making the script for a flood fill is really easy, even on scratch!
All you do is call floodFill with the light source x and y. The target is what types of places will be brightened by the light (for example, air blocks, or blocks touching the air.) The replacement input is the change to the type of place, so for lighting you might change the type of block, like NightAirBlock > litAirBlock, or perhaps change a local variable of the block, like lighting.
Depending on how you want to show this project, the getLocation and replaceArea blocks would be different. If you have your locations stored in a psudo 2Darray with lists your get Location would get the list item corrosponding the x and y, while the replaceArea would either replace the list item with the new type or replace a value in a seperate list for its lighting value. If your just painting on the screen with the pen the get location could go to the location on the screen and check the color it is touching, and the replaceArea would paint over it with the new color.
If your doing lighting, you might want the lighting to decrease the further it gets from the light source. To do that you would add a parameter to the floodFill method for a startX and startY, and then the replacement value would be calculated based on how far (x,y) is from (startX, startY) instead of passed as a parameter.
Making the script for a flood fill is really easy, even on scratch!
define floodFill (x) (y) (target) (replacement)
getLocation (x) (y)
if <(myLocation) = (target)> then
replaceArea (x) (y) (replacement)
floodFill ((x) + (1)) (y) (target) (replacement)
floodFill ((x) + (-1)) (y) (target) (replacement)
floodFill (x) ((y) + (1)) (target) (replacement)
floodFill (x) ((y) + (-1)) (target) (replacement)
end
All you do is call floodFill with the light source x and y. The target is what types of places will be brightened by the light (for example, air blocks, or blocks touching the air.) The replacement input is the change to the type of place, so for lighting you might change the type of block, like NightAirBlock > litAirBlock, or perhaps change a local variable of the block, like lighting.
Depending on how you want to show this project, the getLocation and replaceArea blocks would be different. If you have your locations stored in a psudo 2Darray with lists your get Location would get the list item corrosponding the x and y, while the replaceArea would either replace the list item with the new type or replace a value in a seperate list for its lighting value. If your just painting on the screen with the pen the get location could go to the location on the screen and check the color it is touching, and the replaceArea would paint over it with the new color.
If your doing lighting, you might want the lighting to decrease the further it gets from the light source. To do that you would add a parameter to the floodFill method for a startX and startY, and then the replacement value would be calculated based on how far (x,y) is from (startX, startY) instead of passed as a parameter.
- sippingcider
-
500+ posts
The Time Master, a MMORPG sandbox
Actually, I just thought of a much easier way to do this on scratch. You could have clones, each with local x, y, and type values. For the getLocation method you could broadcast a search message, which the clones would receive and check their x and y values against the x and y value of the flood fill location. If they match, they send their type via a global variable. Then for replacement, they can change their brightness or ghost effects.
- sippingcider
-
500+ posts
The Time Master, a MMORPG sandbox
Ok I couldn't help it, had to try this myself. This might give you some ideas: Flood Fill Lighting
- 2Dproductions
-
500+ posts
The Time Master, a MMORPG sandbox
Pretty good, currently trying to find out why the leaf blocks aren't displaying though. How are trees and ores going?
- 2Dproductions
-
500+ posts
The Time Master, a MMORPG sandbox
Trees are done! Ores are going to use the same logic as caves so they shouldn't take long. How are trees and ores going?
- sippingcider
-
500+ posts
The Time Master, a MMORPG sandbox
What does ECS stand for? The escape key
?

- Scratch_Foxy_Rogues
-
100+ posts
The Time Master, a MMORPG sandbox
Entity-component-system, it's a programming architecture they're adding to Unity which offers performance and logistical benefits over the usual object-oriented approach. What does ECS stand for? The escape key?
Last edited by Scratch_Foxy_Rogues (Feb. 26, 2019 21:52:45)
- 2Dproductions
-
500+ posts
The Time Master, a MMORPG sandbox
Which should speed up chunk loading because of the way the unity job system works, so less lag!Entity-component-system, it's a programming architecture they're adding to Unity which offers performance and logistical benefits over the usual object-oriented approach. What does ECS stand for? The escape key?

- Discussion Forums
- » Things I'm Making and Creating
-
» The Time Master, a MMORPG sandbox