Definitions:
#define ILLEGAL 1 |
String Datum:
String |
Points:
point//point, makes it easier for me... |
Colors:
proc |
necessary procs:
proc |
ID:151410
Feb 11 2011, 4:44 pm (Edited on Feb 11 2011, 4:50 pm)
|
||||||
Well I thought about making a whole bunch of datums for everything I could possibly need and then putting them in one library I can include in my projects. So far I have a String Datum, points, and a color datum, I have another assortment of procs but focusing on the datums right now. Any suggestions on how to improve the current ones and anyone have ideas for future datums?
Definitions:
String Datum:
Points:
Colors:
necessary procs:
| ||||||
Ripiz wrote:
However on other hand, it's quite useless on BYOND. Compared to how slow new() proc is, it'd impossible to make anything decent. Then recycle them. That also solves the problem of how slow del() can be. The only issue would be tracking old references, but since vectors are usually only referenced by a single object, that wouldn't be too bad. | |
I was going to make vectors but for the sake of simplicity I decided to go with points, could always change that though.
| |
#4 Feb 12 2011, 10:03 am
|
||
A DateTime proc would be useful:
You could also include a procs to add or subtract time. You tell it to subtract 57 hours and it figures out how to adjust the hours, day, month, and year vars. | ||
However on other hand, it's quite useless on BYOND. Compared to how slow new() proc is, it'd impossible to make anything decent. This is the second time I've heard this opinion, and I'm not sure why. I quickly wrote some code to test this. The code handled basic "pixel movement", collision detection, and some simple collision physics. It was written as quickly as possible, and was purposefully as unoptimized as it gets. The result: I had no problem creating thousands of vectors a tick, and it ran smoothly with hundreds of objects warping around the screen in the speed of light because someone forgot to bound acceleration vectors (tick_lag wasn't changed, either). I'll admit you should lower your expectations for an online game, but you really have no reason to "fear" vectors. With some basic optimizations (such as recycling vectors, like DC suggested), as well as a decent server, you should have no problem at all running a game with pixel movement online. Anyone who doubts this should simply test it himself. | |
May I see what you have made? Whenever I try to make something it ends up extremely slow.
Could even compare Forum_Account's Pixel Movement library, it runs at 50% CPU on average, pretty much any other language could do it near to 0% CPU. | |
I thought the comparison was BYOND with datums vs BYOND without datums?
| |
Hopefully this works: download. I don't have the source code handy. Use the populate verb to spawn blobs at random (you might have to restart the game a few times if a blob spawns on you, especially if you create 500+ of the buggers). I think you can click objects to have them start moving at random, but I'm not sure. The physics, as I mentioned, is bugged (the mass needs tweaking and bounding doesn't work), so be /very/ careful lest things start moving FAST. #DEBUG is on, I think, so profiling works.
| |
Tried to come up with something like that :P. It works for the most part but I couldn't figure out a good way to increment the text days as well and it can only take timestamps in a single format(DDD MMM DD hh:mm:ss YYYY).
| ||
#10 Feb 12 2011, 6:50 pm
|
|
Packaged the string datum into a library.
| |
To see it, move to the centre of the map, and 'populate 500'. If you're lucky and no blob spawned in your freaking face you should see it after bumping a few. It might take a few tries to get since you're sometimes surrounded by 'blobs sitting on blobs' (the populate verb doesn't bother to check that) which would make them stuck in place for a while. I think I used to have the maximum speed about twice as high, which made this a lot more crazy when you started warping around the screen yourself.
| |
However on other hand, it's quite useless on BYOND. Compared to how slow new() proc is, it'd impossible to make anything decent.