MovingBlocks / Terasology

Terasology - open source voxel world
http://terasology.org
Apache License 2.0
3.67k stars 1.34k forks source link

Water bug makes you swim in the air #1995

Closed DefinitlyEvil closed 8 years ago

DefinitlyEvil commented 8 years ago

If you place two torches right under the water liike:

ooooTR
ooooTR
oooooR

Where o means water, T means torch, R means stone. You go into the torch block and you can swim out of the water and fly in the sky.

DefinitlyEvil commented 8 years ago

Btw this is the first time I play this game and I accidently found this bug. lol

skaldarnar commented 8 years ago

This sounds awesome, let's call it a feature! I probably messed up some checks last time I touched the player movement.

And thanks for reporting!

DefinitlyEvil commented 8 years ago

@skaldarnar You're welcome, will you make a networking library so I can make a plugin extensible server?

Cervator commented 8 years ago

This is a duplicate of #1633 complete with a comment from @skaldarnar last time it was noted :D Up for fixing it soon?

@DefinitlyEvil - huh on the networking library? Current plugins (modules) cover both server and client side. There are also some alternative extensions like the WorldViewer that uses the engine to do stuff like visualize how a world will look given a particular seed and world config. Could you elaborate on what you're wanting to do?

DefinitlyEvil commented 8 years ago

@Cervator I'd love to help. Where can I find the networking documentation please? Or I have to do some Java reading?

Cervator commented 8 years ago

@DefinitlyEvil you generally don't need to worry about networking - the engine hides all those details and adding new stuff in modules just works based simply on the mode you pick. If you want a system (handles logic) that works only on the server (say a plant simulator) you mark the system as follows:

@RegisterSystem(RegisterMode.AUTHORITY)
public class MyServerOnlySystem extends BaseComponentSystem {

So specifically that means the system will only execute on whatever the authority is, which would be a server in a split server/client setup (like headless) or the local instance of the game if you're running single player.

If you want to handle some data (stored in a Component) in a particular way you likewise annotate it in some fashion, like:

    @Replicate(FieldReplicateType.SERVER_TO_OWNER)
    @Range(min = 0, max = 10)
    public float speedMultiplier = 1.0f;

If you want an entity, like a chest, to work in a networked fashion you simply give it a NetworkComponent and the engine handles the rest. Fancy objects (like chests) are defined in JSON prefabs where you can attach Components simply like:

    "Network": {
    }

In this case the Component has no added config so the block is empty. But the Component is still added.

For the full chest prefab see https://github.com/MovingBlocks/Terasology/blob/develop/modules/Core/assets/prefabs/chest.prefab

Generally the best way to approach something is look for the most similar existing example, dig around in the code a bit to understand how it works, then figure out what you want to do differently. If you're trying to do something radically different then it helps to ask in a forum thread and we can advise. Just good to have an idea of what you're trying to do :-)

To learn more check out the wiki here on GitHub, maybe starting with an overview of how our entity system works: https://github.com/MovingBlocks/Terasology/wiki/Entity-System-Architecture

DefinitlyEvil commented 8 years ago

@Cervator Woah that's much more complicated than Minecraft, I guess I have to bury myself into the code for a while. Thanks. ;-)

DefinitlyEvil commented 8 years ago

@Cervator I wanted to do is to implement or use your networking code and users can add component as plugins, like Bukkit or does.

Cervator commented 8 years ago

It helps to forget everything you know about Minecraft/Bukkit for a moment and just look at a simple example in Terasology. I described some of the cases where you can interact with networking as I wasn't sure what you were trying to do. But for the vast majority of the time you just write a System, a Component or two with some data to manipulate, and a few prefabs to make fancy blocks or items - and the most you've thought about is whether the system should execute on the server or the client.

I don't know MC/Bukkit in detail but suspect Terasology is much easier. You never ever need to worry about networking protocols, doing anything custom over the network, or really anything networking at all. Just your desired behavior - the logic and content you want to see.

After you understand how it works and have done something simple you'd like to see work then you can reconsider whether anything from MC/Bukkit land is useful for what you want to do.

Speaking of: I still don't know what you want to do :-) Can you give a concrete example of what sort of ability or event you'd want to add to a world, a player, a block, or something? Chances are you'll be able to do so extremely easily.

Most the time you don't have to worry about the engine at all. You can just mod and create content to your heart's content.

DefinitlyEvil commented 8 years ago

@Cervator I want to make a plugin-exensible server, like login plugin(chat command based).

Cervator commented 8 years ago

@DefinitlyEvil can you link to an example / something similar? I take it something like that exists for MC/Bukkit.

I'm having trouble visualizing where that fits with Terasology. User identities and chat already works. What would this extend? Calling out from a game server to some external service?

One thing that has come up in the past is a mapping utility like DynMap. We already have a WorldViewer utility that uses the engine to see how a world would look after generation using various configuration. However it doesn't interact with a normal running game.

A DynMap analogue might work in some similar fashion, although yes it might need more networking options exposed, like having the engine register a REST api through which you could request mapping data from an external utility. If you then wanted to have in-game admin options for that via console commands (distinct from chat) then yeah that's another interface of some networking sort that needs to be exposed.

Is that the kind of thing you're curious about?

DefinitlyEvil commented 8 years ago

@Cervator Yes that's what exactly I want to do! ;-D

Cervator commented 8 years ago

Alright, glad I finally understand, thanks for bearing with me :-)

At this point we should probably take this to a suggestion thread in the forum - I've started one up: http://forum.terasology.org/threads/game-server-web-api.1406/

Could you please register there and voice your interest in working the item? We can get some others involved in providing design advice when we have a willing worker :-)

I'm going to close this issue now since the original problem is a dupe and the rest of the discussion sort of went off on a tangent :D

See you in the forum!

DefinitlyEvil commented 8 years ago

@Cervator See you on the forums.

DefinitlyEvil commented 8 years ago

@Cervator I faild to register, that stupid ReCAPCHA thing just won't load. :-(

Cervator commented 8 years ago

Odd, I just checked it and get an image fine. Are the options to reload or listen to audio working?

Cervator commented 8 years ago

@DefinitlyEvil if you can't reach the image from your location somehow just send me your preferred username + mail address to cervator@gmail.com and I'll set up an account for you.

DefinitlyEvil commented 8 years ago

@Cervator Nevermind, it works for me today. ;)

Cervator commented 8 years ago

Incidentally, the original issue reported here is now fixed :-)

Hope you're still around, @DefinitlyEvil ! We have many more things to do :D

DefinitlyEvil commented 8 years ago

@Cervator I am always here to help! :D

Cervator commented 8 years ago

@DefinitlyEvil are you still poking at the code to learn about networking and related things, or waiting for more clues, direction, time, or anything? :-)

I'm getting a bit more involved with REST API stuff and maybe microservices at work which might eventually help with giving a Terasology server some fun web stuff. But I imagine it'll be January before I really get a chance to get into it.

DefinitlyEvil commented 8 years ago

@Cervator I am working on some other real life stuffs. xD And I checked the networking code it is using a crazy complicated networking framework with Apache Protobuf which I am not familiar with it. Btw I will probably be free in July(2016).

Cervator commented 8 years ago

RL can be a cruel mistress! :-)

Yep the networking deep in the engine is probably one of the trickier bits to work with. If you have some free time look for some of the basic contributor friendly issues to get started and work toward big stuff like networking. Now, later, July, or sometime, there'll always be more work! Just keep in touch :-)

Cervator commented 8 years ago

Oh, and just for the record you still wouldn't actually need to interact with the networking at the protobuf level. Forget all the mess from MC land :-)

In this case you'd simply expose a new endpoint with REST activated then listen for incoming requests. If some request comes in asking for number of players online you then just hit the right engine method to get that number and put it in a REST response. I doubt we'd want the REST API running protobuf (unless there's some benefit for that in sending back large quantity of map data)

DefinitlyEvil commented 8 years ago

@Cervator I think there is already a library for REST server maybe? If now we can use Netty it's more powerful. ;)

Cervator commented 8 years ago

We already have Netty hooked up :-)

https://github.com/MovingBlocks/Terasology/blob/develop/engine/build.gradle#L98

And yeah, library all the things!

DefinitlyEvil commented 8 years ago

nice