In response to Oasiscircle
Oasiscircle wrote:
You can easily fix that problem by hosting a dedicated server. I suggest using the services of BYONDPanel.

Thank you for missing my point entirely. As the owner of the game you can create dedicated servers which will receive the highest velocity of players. Forum Account said that if players complain your dedicated servers are too laggy, you should let them make the servers.
In response to Red Hall Dev
You can't expect players' servers to be better. But you can expect, within reason, to be able to purchase a better server.

In response to Oasiscircle
Oasiscircle wrote:
You can't expect players' servers to be better. But you can expect, within reason, to be able to purchase a better server.

I don't even know about that, you can throw 4 cores at DreamDaemon and it will only use 1 thread on 1 core. The only thing you could improve would be ram but even then it doesn't need much ram. So no, not really. You can buy a better server but you're not getting any extra performance.
Red Hall Dev wrote:
Sounds like you're selling a model whereby all players just make servers and connect with people they know. That would be fine but there's one problem. Byond has been developed to appear it's capable of that, it even offers "Play, Join A Game, Host" but the problem is that anyone who clicks the host button needs to know how to portforward. ... playing it by themselves which is boring.

If the game is boring to play there's not much you can do to fix that. You've just got to make a fun game otherwise it won't work. If the game is fun, people will invest the three minutes learning how to forward a port so they can play with their friends. The easiest way to show that your game is fun is often to let people play it by themselves. Once they see how good the game is they'll want to play with other people and won't mind tolerating a little latency because they enjoy the game. You can provide a dedicated server people can play on (in addition to offering the ability to host their own servers), but it's harder to guarantee that it'll show people how much fun the game is.

I don't see how your model works. It just means dedicated players will work it out and make a very small number of servers, basically your game with this model will go no where.

If you rely on having dedicated servers you're limiting how many people can play. Unless you're willing to set up hundreds or thousands of servers, the player count will be very limited. If people can download your game, play it by themselves, and set up servers as they need to, you've potentially got as many servers as you've got players. Having a dedicated server might guarantee that you can support 50-100 players, but for the player counts you should be aiming for, 70 players is nothing. If you wanted to support 2000 players (which isn't that many when you think about how many players other games have) you're probably not going to be able to set up that many dedicated servers.

Oasiscircle wrote:
You can't expect players' servers to be better. But you can expect, within reason, to be able to purchase a better server.

That depends. If you have one dedicated server with 50 players and player-hosted servers with 3-10 players each, you'll probably get a better experience from player-hosted servers.

SuperAntx wrote:
Forum_account, your latest posts sound eerily similar to something I said awhile ago which you still decided to side against.

I was saying the same thing in that thread. People see a little latency, freak out, and assume lag will be a problem and their game wouldn't work, but that people will be surprised at how well BYOND can handle things and how much people will tolerate to play a fun game.

I can't determine if I actually got through to you or you're just flip-flopping your opinions for the sake of debating people. Just the other day you refused to acknowledge how some features are effected by lag more than others yet here you are saying it's a developer's own fault for making a game which doesn't run well on BYOND.

The thread you linked to there also talks about making first-person shooters with BYOND and I said that BYOND wouldn't be able to handle that well. Of course I agree that some features won't work as well as others and that some are too impractical to work at all, but the draggable selection boxes just isn't an example of a feature that wouldn't work.
Regarding the topic title, "Stop Being Afraid of Lag," I have to disagree. To me, that implies that there is little you can do to cause lag. What the situation really is, though, is: don't fear lag, expect it and plan for it by designing games with BYOND's strong points in mind.

I sure wish I was more experienced in what BYOND is actually strong with.
"lag" is a very nebulous term. People label different things as "lag" and that's where this irrational fear comes from - most people don't even understand what it is. I think what often happens is that people start working on a game, test it with a few friends, and notice the latency. They figure that the lag they're seeing would scale with the number of players - if it's lagging that much with three people they figure it'd be unplayable with 20 people. It doesn't work that way but people use this to psych themselves out (this is where it also doesn't help that people often think they have to support 100+ players per server or it's not a real game).

There is always going to be latency and because the BYOND server handles almost all of the work, latency can cause problems. That's the part you have to expect and plan for. It wouldn't be very much fun to make a multiplayer reflex test because latency would give the host a huge advantage.

Kaiochao wrote:
I sure wish I was more experienced in what BYOND is actually strong with.

I'm not sure what you mean by that. I haven't found too many things that BYOND is bad at (of the things you'd bother to try). A Miner Adventure has pixel movement, dynamic lighting, and lots of objects (to create flowing water) and I never had to go out of my way to improve how it runs over a network.

People look for things that BYOND can or can't do (ex: BYOND can't make racing games, BYOND can't handle shooters, BYOND can't handle pixel projectiles, etc.) but BYOND doesn't know the difference between any of those things. To BYOND, it just comes down to how many objects are being created and updated. If one game can have 30 objects moving smoothly across the screen so can another game - it doesn't matter if one of those games is a racing game and the other is a shooter.
You might want to play SS13

The lag scales exponentially with the amount of players, with 50 players you have about 0.4 seconds worth of lag and moving is awkward as hell

Then again DM code itself executes extremely slowly which is causing a lot of the lag due to the complexity of the game
In response to Tobba
Tobba wrote:
Then again DM code itself executes extremely slowly

In comparison to what?
In response to Albro1
A decent interprented language like Lua
In response to Tobba
Tobba wrote:
A decent interprented language like Lua

I like to assume that the DM code execution is doing quite a bit more than Lua code execution. Especially seeing that the DM code executor (I believe Dream Daemon for multiplayer worlds, then Dream Seeker has its own for single player worlds, but please correct me if I am wrong as I never looked into it) has to constantly deal with networking at the same time.
Try playing a game with over 100 players concurrently, it rarely is a CPU problem, you run out of upload bandwidth on the server side. It is frustrating when CPU usage is <20% but the game is stuttering, I wouldnt recommend any high player count high FPS concepts.
In response to Tobba
The reason that code is executing slowly in SS13 is because from my experiences with the /tg/ source-code the game is poorly written (although better than most BYOND games).

For example, a major leading cause of lag was in the HUD updating routine: This is a routine that checks every second (among other things) what you can and can't see. This is somewhat understandable IMO since rewriting the game to properly handle every situation would be tedious and boring work and would be too error prone.

The HUD updating routine has a piece of code in it that checks if the player is standing on a specific 'rune' object. If they are, it'll allow them to see invisible players (this is for the "cultist" game mode).

However instead of checking if there's a rune in src.loc, it loops through every rune object in world. SS13 has a lot of objects, so even with a typepath specified it takes BYOND a while to create a filtered list. This additional overhead caused this proc to appear at the top on our version.

When I fixed this issue, the proc was using 0.000 CPU (0.001 after the server was running for a while). Before that it used to increase by about 0.150-250 per player every second.

Over time I've found numerous other things that would cause CPU lag. I've also found a disturbing amount of uses of the colon (:) operator in places where it isn't necessary. In one case giving a global function the same name as a global one caused BYOND to execute the global function instead of the local one when : was used. This caused an unforeseen bug that was harder to diagnose because it wasn't related to anything we did.
BYOND allows you to very easily to build an online game and there's an existing player base you can tap players from. A lot of things are already handled for you that would probably give you a headache if you have to do it all by yourself. Some people complain about BYOND and claim it sucks, but they're not appreciating how much it already does for you. You don't really know what you're missing until you research how much work you'd have to put in just to get a basic environment up and running.

However the same things that make it so easy to build an online game with BYOND is also what's dragging it down. The use of a thin client means that the only client-side processing you can do involves Javascript code. There are bugs in the software that you can't address by yourself and if you're involved in projects like SS13 you may encounter freezes without anything being logged (and with world/loop_checks=1) which can be terribly frustrating.

The lack of a proper IDE when you're used to Eclipse can be pretty frustrating as well. As is the inability to catch errors using try/catch statements.

In recent years it's become possible to extend the language yourself by creating your own C/C++ libraries. This is all strictly server-side but this will allow you to run tasks that require heavy processing (like SS13's atmospheric system) on a separate thread, which can significantly reduce CPU lag.

The two biggest problems I've seen with BYOND are the following:
1) A lack of developers producing games that actually know what they're doing. There's a big group of people developing Anime games that fit this description but outside of that there are a lot of games run by amateur hobbyists who have no inclination to read the DM Guide let alone experiment with the language.

Most developers who come here have only one desire: to have a playable game. This causes them to cut corners, to resort to using existing work (guilty!), and to reject help out of fear that their work will be stolen.

2) The development of BYOND is something that's kept secret. There is no projected timeline of changes, there is no list of features/bugs ordered by priority that we can access, and IMHO the tracker is ill-equipped to deal with a community this size as the statuses are too vague. Since I complained about it there was a change in that an updated beta version is now always available to those that would like to test upcoming features, so it's a start.


Before I hit "save": I'm not posting this to offend anyone, but only to share my opinions, which I should be entitled to. I'd rather not start a flame war over this, so please don't think I addressed someone directly with this post.
In response to JBoer
JBoer wrote:
but they're not appreciating how much it already does for you. You don't really know what you're missing until you research how much work you'd have to put in just to get a basic environment up and running.

I believe isometric rendering and interface are hardest things. Simple tiles are really easy to draw. Learning how to use APIs (OpenGL/DirectX) would take long time, but remaking SS13 or similar games won't be hard at all.
In response to Zaoshi
Zaoshi wrote:
JBoer wrote:
but they're not appreciating how much it already does for you. You don't really know what you're missing until you research how much work you'd have to put in just to get a basic environment up and running.

I believe isometric rendering and interface are hardest things. Simple tiles are really easy to draw. Learning how to use APIs (OpenGL/DirectX) would take long time, but remaking SS13 or similar games won't be hard at all.
  • Graphics engine: you need to be able to see the game.
  • Sound system: to be able to hear sounds.
  • Keyboard/mouse I/O
  • Networking: it needs to be secure, it needs to be fast, yet it needs to be accurate.
  • Development tools like a map editor
  • Native browser control w/ the ability to send "internal" links (or you'll end up with even more work as all the interfaces are in HTML)
That's a rough list of the stuff you'll need in order to do it. Once you've completed the above tasks you'll still need to actually port the game over to another language; i.e., porting over the code to your new version.

There's so much work involved that you'd need a small team of active developers to be able to pull that off in a reasonable time. In the end you'll end up with the same game you've got on BYOND, minus a bunch of functionality you'd undoubtedly be missing out on (other versions aren't standing still). The benefits you have from multi-threading some pieces and having the game run smoother fall far short on the additional overhead you'll have when wanting to make changes to resources, the UI and the map.

What I'm saying is that it's not a question of how difficult it would be to pull off (you can pull off just about anything if you put enough research into it) but how feasible it is to pull off.
In response to JBoer
JBoer wrote:
Graphics engine: you need to be able to see the game.
DirectX or OpenGL will draw it, just gotta learn how to tell it what to draw

Sound system: to be able to hear sounds
There are libraries for that, a bit of Google and you'll find it

Keyboard/mouse I/O
Windows API sends event of keypresses and mouse movement/buttons, using them is quite trivial

Networking: it needs to be secure, it needs to be fast, yet it needs to be accurate.
You won't get better speed than UDP. BYOND uses simple TCP, it's easy to implement and solves a lot issues.

Development tools like a map editor
This MIGHT be a problem depending on a game. Complex environment will definitely require good map editor, something easier can be hard-coded.

Native browser control w/ the ability to send "internal" links (or you'll end up with even more work as all the interfaces are in HTML)
I'm not sure what you mean by this. You can create window that parses HTML without issues (it's somewhat provided by Windows)

The benefits you have from multi-threading
2D games usually don't need multithreading, it's only useful for heavy operations, since OS doesn't switch threads very often.

but how feasible it is to pull off.
Anyone who had any experience in the past could pull off basics quickly. As BYOND exists, simply copying it's interface of object interaction would be a huge boost, with documentation it's easy to solve and reproduce behavior of everything.
In response to Zaoshi
Zaoshi wrote:
Anyone who had any experience in the past could pull off basics quickly. As BYOND exists, simply copying it's interface of object interaction would be a huge boost, with documentation it's easy to solve and reproduce behavior of everything.

You're being naive. "Simply copying" doesn't apply to a project of this magnitude. Even with access to third-party libraries you're still going to take a lot of time developing it as you need to factor in the time it takes to design stuff.

Someone who has had experience with game programming and actually created a project before will have a better idea of what to do, but it's still an awful lot of work porting over all the existing functionality.

And someone who doesn't have experience with all of the things that need to be implemented will need to spend time getting to know how the various libraries work.

All that just to get the same game seems like a waste of time to me. IMO anyone who has any experience in game programming outside of BYOND would see that sticking with BYOND is the best thing to do in this case for the reasons I mentioned in my previous post.

Zaoshi wrote:
DirectX or OpenGL will draw it, just gotta learn how to tell it what to draw

You also have to facilitate a way for the client and server to be aware of a "map" and to know what to render. You'll also need to make sure that animations play properly and smoothly.

There are libraries for [sound systems], a bit of Google and you'll find it

I admit that the FMOD library allows you to do this quite easily, so IMO this isn't that big of an issue if you're already familiar with that library.

Windows API sends event of keypresses and mouse movement/buttons, using them is quite trivial

Simply being able to receive events is not what you need in order to make a game. You need to write your own event framework lest you end up with spaghetti code.

You won't get better speed than UDP. BYOND uses simple TCP, it's easy to implement and solves a lot issues.

The latter (requiring accuracy) is why TCP is required. But again, there is more to it than just being able to send/receive messages: you need an entire framework for this.

When a player presses a button on the keyboard, you need to be able to send it to the server. The server needs to send map updates to all the clients taking into account what state they're in.

How would you make sure that the player has all the required resources like icons and sounds? BYOND does this for you automatically by packing them into a resource file upon compilation and sending that resource file in the background to the client upon connection.

This MIGHT be a problem depending on a game. Complex environment will definitely require good map editor, something easier can be hard-coded.

Not only do you need a map editor, but you need to define what a map is, and what the elements on a map are. This needs to be in a format that at least the server but most likely also the client can understand.

I'm not sure what you mean by [native browser control w/ the ability to send "internal" links]. You can create window that parses HTML without issues (it's somewhat provided by Windows)

When you use a byond:// link within Dream Seeker it will automatically call a proc in BYOND. You'd need to copy this functionality or waste a lot of time redoing interfaces.

2D games usually don't need multithreading, it's only useful for heavy operations, since OS doesn't switch threads very often.

This tells me that you don't have much experience with programming outside of high-level languages like BYOND. Multi-threading is most definitely needed in a 2D game. Otherwise, how can I see what's on the screen and press a key at the same time? How can the server send the resource file to the newly connected client and not cause all other clients to freeze up?

BYOND does use multi-threading to an extent-- just not when processing code, which happens (somewhat) sequentially. This is to protect people who don't know much about multi-threading from the additional knowledge you'd require; it's to make the language easier for people who don't know a lot about programming.
In response to JBoer
JBoer wrote:
You also have to facilitate a way for the client and server to be aware of a "map" and to know what to render. You'll also need to make sure that animations play properly and smoothly.
Server has nothing to do with rendering, as for client, just draw all tiles which are near your mob (or client.eye if it's implemented). There's little logic in animations, but since they don't need smooth transition like 3D skeletal animation do, it's not really hard, just display one or the other image.

Simply being able to receive events is not what you need in order to make a game. You need to write your own event framework lest you end up with spaghetti code.
Roughly speaking it might look similar to this:
switch(msg) {
case WM_MOUSEDOWN0:
// find whatever was clicked and call Click()
break;
case WM_KEYDOWN:
if(keyMapping[param0]) // assuming it's array of function pointers
keyMapping[param0]();
}


The latter (requiring accuracy) is why TCP is required. But again, there is more to it than just being able to send/receive messages: you need an entire framework for this.
There's not much framework to this, just receive incoming data, figure which client sent it and then process it if whole packet arrived.
Personally I used boost and created single-threaded IOCP. Together with client code, server code and packet parsing it's less than 300 lines.

When a player presses a button on the keyboard, you need to be able to send it to the server. The server needs to send map updates to all the clients taking into account what state they're in.
auto client = FindSender(packet);
switch(packet_id) {
case PLAYER_MOVE:
for(auto &player : playersOnline) {
if(distance(client.position, player.position) <= 6)
network.send(player.address, client.id, client.position);
}
break;
}

However, it's also possible to copy BYOND, and just tell all clients "Entity X moved into Entity Y", where X is player and Y is turf.

How would you make sure that the player has all the required resources like icons and sounds? BYOND does this for you automatically by packing them into a resource file upon compilation and sending that resource file in the background to the client upon connection.
Some games don't pack resources in any way, you don't have to do that either. It'll be few hundreds/thousands files, but if they're in separate folder there's no problem with that.
BYOND's architecture is such, that Dream Seeker is unaware of anything, server (Dream Daemon) tells what to display. You don't have to recreate this, just make whole client downloadable. File transfer over network isn't any different from transferring any other kind of data.

Not only do you need a map editor, but you need to define what a map is, and what the elements on a map are. This needs to be in a format that at least the server but most likely also the client can understand.
Map is just bunch of tiles, they can be as abstract as /atom in BYOND. The way BYOND works can be copied to simplify porting of the game, as well as solving different issues which you have to solve yourself normally.

When you use a byond:// link within Dream Seeker it will automatically call a proc in BYOND. You'd need to copy this functionality or waste a lot of time redoing interfaces.
Why recreate BYOND? You are making a game. Hard-code IP into client and that's all.

This tells me that you don't have much experience with programming outside of high-level languages like BYOND. Multi-threading is most definitely needed in a 2D game. Otherwise, how can I see what's on the screen and press a key at the same time? How can the server send the resource file to the newly connected client and not cause all other clients to freeze up?
There's hundreds of game that run in single thread, ignoring the fact that any Windows application has multiple threads as soon as it starts.
So you can judge my skill based on single statement? Well it somewhat means I can judge your skill based on what you just said. And I should said you have little to none.
// not an actual code, but very similar
while(true) {
Message msg;
while(ReceiveMessage(&msg)) // receive all message from Windows (input, etc)
ProcessMessage(msg);

Packet p;
while(ReceivePacket(&p)) // not best interface, but looks nearly identical to previous loop
ProcessPacket(p);

UpdateFrame();

DrawFrame();
}

This is basic 'game' loop and it's nearly identical in all single-threaded applications.
Because of how TCP works by default packets would have to received on separate thread, but it's possible to create non-blocking socket eliminating any need for extra thread.
In response to Zaoshi
I think you're being too naive. But okay, if you're so clever and it's so easy for you to do then why don't you do it?
I'm already doing, but I went for 3D.
World is already through 2D games, they're history.
Same way as Flash is history, it's dying.
Page: 1 2 3 4 5 6 7