ID:109565
 
Keywords: events, roses
I've just recently been in discussion with Toadfish and Alathon separately on BYOND currently featured libraries. The discussion essentially centered around how "healthy" our current library set is, do any need replacing or extending and so on.

The conclusions have been very mixed, with interesting points brought up by both sides in the case of particular libraries and the general state of affairs. So just before cracking on, I thought I'd put the question(s) to you: Are the current featured libraries any good? Do any need replacing or extending? If so, why?

Another interesting and open question is of course: What libraries are we missing?

It is probable that if I see a good need off the back of the comments, or an idea just interests me, I'll engineer a library for it.

On a related note, a game called Dragonball Phoenix recently picked up my Event Scheduling library to help them better organise their project and improve performance.

The results have been very positive, as before it's use they would just about fit 50 players on their test server and it would be really hammering the CPU. They made some early use of it to de-couple a few game mechanics, and managed to push 75 players before any CPU use started to come into play, and ~100 players was about their limit, as it was killing their CPU.

I'd done a quick review of their code and their use of the library, and there is plenty they could do to improve further. However regardless of how you cut it, managing to double their workable capacity was a nice boost, and a good proof that the library 1. improves performance for big games and 2. encourages you to program cleanly.

I'm still looking to improve the library itself, and add a thorough demo to the download. The current implementation is actually pretty naive and could be made to be more efficient without harming the functionality or API.

In other news, watch out for a DevTalk from myself and Alathon stepping through his recent Telnet input snippet, discussing the process of going from good idea to good library, including the kind of things he and I consider when doing this process, and problems we design for in a library. If you're keen to make top notch BYOND featured libraries, this will definitely be a good blog for you!

Thanks for reading. Do share your thoughts in the comments, and ROSES.
There are a lot of different weird math functions I could use.

- Enter a few map coordinates and return a basic shape of tiles making up the connected points.
- Take a basic shape of map tiles and return the tiles making up the area of the shape.
- Some kind of natural fluid-fill algorithm for figuring out the natural flood area of a "water leak."

Probably some other stuff I can't think of as well.
I'll look into it, it sounds quite neat actually.
SuperAntx wrote:
- Enter a few map coordinates and return a basic shape of tiles making up the connected points.

Graham's Scan / Jarvic's gift-wrapping algorithm may be good for this, depending on the number of points.

- Take a basic shape of map tiles and return the tiles making up the area of the shape.
- Some kind of natural fluid-fill algorithm for figuring out the natural flood area of a "water leak."

Probably some other stuff I can't think of as well.

One more thing which I guess is missing is a way to calculate arcs. There are libs for straight lines everywhere but if you wanted to calculate something like the point of impact for a projectile in Bombard you're out of luck.
You'll be better off just fudging water calculations, that stuff can get complex. Arc calculation like in Bombard looks like a simple matter of rotating a parabola (along with tweaking some variables), though.

Edit: I'm pretty sure he's not actually calculating arcs in that game, he's just simulating gravity to change the canon ball's velocity. The terrain might be several parabolas with noise, but it looks more like he was just changing a vector's velocity at random, with some bias.
Graham's Scan / Jarvic's gift-wrapping algorithm may be good for this, depending on the number of points.

It's not exactly clear what SuperAntx meant, but I don't think most people would be looking for convex hulls. Most likely they'd have a set of points defining the edges of the polygon. To identify the tiles along the edge you essentially run a line-drawing algorithm for each of the polygon's sides. To identify the tiles inside the polygon you can use a flood fill algorithm.

Most of these ideas sound more like demo ideas than library ideas. I don't think BYOND needs a library to do every little thing. For simple tasks it's not worth the trouble of figuring out how to integrate the "arc library" with your project. It would make more sense to have a simple demo and article to explain the concept so that people can learn how things work and implement it on their own.
Toadfish wrote:
I'm pretty sure he's not actually calculating arcs in that game, he's just simulating gravity to change the canon ball's velocity.

I wasn't asking how to launch a cannonball, I was asking how to calculate its point of impact.

Forum_account wrote:
Most likely they'd have a set of points defining the edges of the polygon. To identify the tiles along the edge you essentially run a line-drawing algorithm for each of the polygon's sides. To identify the tiles inside the polygon you can use a flood fill algorithm.

Yeah, that's pretty much the idea. Here's a graph to help illustrate what I'm saying.
In a game like Bombard w/ static geometry, it's simply a matter of calculating the parabola's intersection with the curve. This isn't really a matter suited for a library, but more a tutorial on the math or somesuch. Calculating the intersection can vary in complexity depending on the curve, but something like calculating the point of impact of a parabola with a Bezier Curve shouldn't be difficult.