Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
Im guessing he just hard coded it into the game (just for that one block in that specific world)
\
It's true
but i don't think it is really that hard.
We can add moving platform block which has:
* Starting point
* Ending point
* Corrent Location
It should loop between those 2 points (not very hard to make)
To display this: When game tries to draw this block you just need to give it offset from Starting point to Corrent Location.
To detect collision: I think it's not very hard either:
1) block = Math.Round(Current Location)
2) check in Player.cs if (cx == block.x && cy == block.y) this.killPlayer();
Offline
destroyer123 wrote:Its a lot harder than you would think, especially as im guessing that to keep the physics as they are (as I think is the plan), you would have to write it all yourself anyway
Secondly, you somehow have to fit the moving blocks into the main game loop, you cant just have a loop and a sleep or whatever, otherwise the rest of the game would freeze. There would need to be a fairly complicated physics engine, as well as adding the actual code that moves the blocks around / redraws them on the screen (which is currently nothing like how the game works already, so you would have to rewrite most of it anyway)right now you look just like the spanish inqusition, afraid of making unusual changes to the game. the physics engine will NOT collapse just because moving platforms will be added.
as i said before, if EE physics will be done the right way in Unity it will be really easy to implement moving colliders. you actually can have a simple loop to move them around, why would that make the game freeze? the loop would be executed on a separate script which is specific for that platform.
"There would need to be a fairly complicated physics engine"
>are you implying that Unity 2D physics engine is not suitable and a new one will have to be written from scratch just to make moving colliders? because thats nonsense
"as well as adding the actual code that moves the blocks around / redraws them on the screen"
you dont say? obviously some bits of code will have to be written, but those bits of code are really simple and small in comparison to most of other thingson top of that, now that this Goshadude proven it to be possible with the crappy retarded Flash player, it should be much much easier and doable in UnitEE
Firstly, I was more thinking of flash for most of that reply, but most of the points are still relavent to unity
I'm not completely sure about this, but I don't think that the inbuilt Unity physics engine would be used for EE, this is because it would probably change the way the physics works, and last time that happened, players moaned until it was changed back and the devs said they wouldn't change it again
My other point was that you can't just put loops randomly throughout your program, unless you want to run them on a seperate thread, which really wouldn't be a good idea (it would create huge lag problems, as well as timing issues)
I was more thinking of this as a problem for flash though, because unity implements its own updates every tick, which you could use instead
The drawing problem is only really a problem in flash, as I think unity handles it all for you
Finally, although what Gosha made is a good example for how you would want it to look, it doesn't really solve any of the above problems (if I'm correct and he has just hard coded it into the game), it doesn't really implement any of the existing physics, it seems to just check if you are somewhere near the block and kill you if you are
It also doesn't tackle the problem of how to actually move the blocks (it seems to just add a single variable for the position, which would work for one platform, but as soon as you are allowed multiple, you would need a much better way to do it, as in a lot of new data which was to be stored in the blocks, or a way for seperate blocks to interact, and an actual block update system, which actually moves the block (solved in unity), which would also need to update the physics each time a platform moves to prevet some platform specific bugs
I guess seem that drawing it to the screen was easier than I expected though
Edit: although unity solves the smaller of the 2 problems I have outlined, it leaves alone the biggest problem of the physics (unless you are happy to completely change EE, and break basically every world ever), and I don't really think the current staff have enough time / patience / experience with the physics (as it hasn't been touched for since Chris) to fix that problem
Offline
as well as the collision detection (which doesnt seem to be working properly in the example anyway)
It is because i used Math.Floor instead of Math.Round
It kills me little bit lefter to the block.
Offline
destroyer123 wrote:as well as the collision detection (which doesnt seem to be working properly in the example anyway)
It is because i used Math.Floor instead of Math.Round
It kills me little bit lefter to the block.
Oh ok, I guessed it would be something like that
My point still stands though, that although that is a good example of what it should look like, it doesnt really prove that its easy to impliment or anything, as youve avoided most of the most difficult issues to solve
Offline
I don't think that the inbuilt Unity physics engine would be used for EE, this is because it would probably change the way the physics works, and last time that happened, players moaned until it was changed back and the devs said they wouldn't change it again
Edit: although unity solves the smaller of the 2 problems I have outlined, it leaves alone the biggest problem of the physics (unless you are happy to completely change EE, and break basically every world ever), and I don't really think the current staff have enough time / patience / experience with the physics (as it hasn't been touched for since Chris) to fix that problem
if the Unity physics really won't be used then a physics engine will have to be written from scratch regardless of whether the game will have moving colliders or not, you cant just copy&paste it from flash player into Unity with no changes made
and imo if they're actually going to do it (creating a new physics engine) then they should be doing it with moving elements taken into consideration from the very beginning
Offline
▼destroyer123 wrote▼destroyer123 wroteif the Unity physics really won't be used then a physics engine will have to be written from scratch regardless of whether the game will have moving colliders or not, you cant just copy&paste it from flash player into Unity with no changes made
and imo if they're actually going to do it (creating a new physics engine) then they should be doing it with moving elements taken into consideration from the very beginning
I know they will be rewriting it either way, but if they change it to allow for moving blocks, then it will need to be completely redesigned (and a complicated physics engine like what would be needed isnt an easy thing to design), rather than just ported over or whatever
I would agree that if this were to be added, it should be done now, but that would probably delay unity by many months (considering the speed its going at atm), so im not sure if it would be worth it, even if it might work somewhat towards getting more players to play the game
I did just think of another problem though, which is that there would be pretty much no simple way to actually place the moving blocks, which could even drive away players if they dont understand how to do it
Offline
I know they will be rewriting it either way, but if they change it to allow for moving blocks, then it will need to be completely redesigned (and a complicated physics engine like what would be needed isnt an easy thing to design), rather than just ported over or whatever
it wouldnt need to be completely redesigned just because there would be colliders that can move
as i said before, the physics will not collapse and will not cause time-space ruptures/gaps/whatever that is just because of moving colliders.
I did just think of another problem though,
more like "ha i came up with another silly excuse to drop this whole idea with moving stuff"
there would be pretty much no simple way to actually place the moving blocks,
>you allow vertical and/or horizontal movement only
>you place control points/nodes and the platform moves from one to another in a constant loop
simple UI for that
players are not retarded enough to be unable to place 2 blocks on a straight line.
Offline
▼destroyer123 wroteit wouldnt need to be completely redesigned just because there would be colliders that can move
as i said before, the physics will not collapse and will not cause time-space ruptures/gaps/whatever that is just because of moving colliders.
With physics, you generally ignore problems that will never actually happen (why so many games have falling through the world problems, in very specific conditions)
This means that none of the current rules will allow for the moving platforms, because it wasnt needed when the game was created
Just to list a few of the things that would need to be changed:
The actual way of finding the collision rectangles of blocks would need to be changed, as the blocks are no longer stored inside the world array, they are seperate entities, this would mean either patching this bit on at the end, which would be messy and slow (as you would need to check almost every single moving block (and therefore every single block to see if it is moving if you dont redo a large part of the way the world is stored) every tick) or completely changing the way the collision detection works
The blocks would need to push players, which would mean that they could no longer be treated as impassable walls, they would have to actually have their own logic, other than the current 'just a rectangle' approach
Something would need to happen if players were squished into places they could not fit, that wouldnt lead to the player either being stuck, or being able to glitch through basically any minigame
Just these few things would probably create hundreds of edge cases, which would each need to be dealt with seperately, which would lead to an incredible messy, very slow / laggy physics engine
So basically yes, the current physics would fall apart
▼destroyer123 wrote>you allow vertical and/or horizontal movement only
>you place control points/nodes and the platform moves from one to another in a constant loop
simple UI for that
players are not retarded enough to be unable to place 2 blocks on a straight line.
I guess that that would work, but there would still be a lot you would have to change, e.g. speed, what order the platforms should move in, possibly synchronisation between platforms (otherwise it would be basically impossible to make minigames using more than one of these moving blocks), where the block starts at when the world is loaded etc, which would easily make it the most complicated gui in the game
Also you would need to think about things like error messages for if a player doesnt place a new block in the row, what happens when just one of the blocks is removed etc
Offline
[ Started around 1711633124.0682 - Generated in 0.068 seconds, 12 queries executed - Memory usage: 1.55 MiB (Peak: 1.72 MiB) ]