Worklog for Warpy

Worklog 1

Return to Worklogs

Twoot(Posted 2009-01-12)
I've had an idea!



Twoot


It began with a simple set of boids, with the rules changed so they're not completely stupid.
Then each boid has a job, which it follows while manoeuvring round the traffic.
At the moment the only thing they can do is build "forts", which they do by going to a quarry, picking up resources, and taking them back to a construction site.
A construction site advertises its need for boids by emitting a radio signal, represented by a growing circle.

It's pretty clever!

I'm going to change the quarries into asteroids-style things and add another class of boids who shoot them up, and then add teams so you can send your boids off to fight each other.

yes, it's warpy! | code | maths.

Amsterdamnit(Posted 2008-09-19)
trader.exe or trader.bmx

For ages I've wanted to make an empire-building game where you don't directly control any part of your empire, but instead your throne room or office or banca and issue orders and write letters to get things done.

I imagined playing the role of a merchant in the 1600s - you remain in your warehouse, controlling the flow of goods in and out of your control, and sending underlings out into the markets or in ships to foreign ports to buy and sell goods, and bring back information about the state of the world.

This is a very hard thing to make for two main reasons - first, simulating a bustling world that would act realistically without the player taking part, and second, providing an intuitive yet appropriate interface between the player and the world.

I've had a strike of inspiration on the second problem. I wanted the player to control the world by writing letters to his underlings or other agents in the world, giving instructions to buy or sell goods, or requesting information. To just let the player write any old letters would require a vastly complicated natural language parser and would in fact be quite tedious for the player, writing out salutations and verbage when all they're really saying is "buy coffee now!".

So I've written a 'predictive text' system , which not only guesses what word you're typing, but operates on top of a well-defined grammar (almost in Greibach Normal Form, but I break the rules now and then) which ensures the commands issued are in the correct form, for easy parsing. It also has a real-time validator and 'guesser' which check you've provided the right types of parameters and offers hints on what you might want to type next.


Here's my grammar definition so far:
$ -> sell ?myquantity ?product for ?amount ?per 
$ -> buy ?quantity ?product for ?amount ?per 
$ -> start trading in ?newname 
$ -> how ?muchmany ?stock do I have? 
$ -> what is the price of ?product 
muchmany -> much 
muchmany -> many 
stock -> ??product 
stock -> money 
quantity -> ??number 
myquantity -> ??number 
myquantity -> ??percentage of my 
myquantity -> all of my 
product -> ??product 
amount -> ??number 
amount -> ??money 
newname -> ??name 
per -> each 
per -> <nothing>


Each line defines a rule of derivation, with the first word representing a symbol, and everything afterwards representing the string that symbol can be replaced by. ?<name> represents a symbol called <name>, and ??<name> means take input of the type <name>.

Oh, and you can press tab or enter to autocomplete words or lines, respectively.

yes, it's warpy! | code | maths.

I've got a TIP for you. Get the POINT?(Posted 2008-01-10)
Here's what I've been working on lately:


Toledo steel .bmx and .exe

yes, it's warpy! | code | maths.

bah.. no more compiler generator :P(Posted 2002-03-28)
well, the compiler generator lasted until I got to strings :P
I'll write a proper ocmpiler in plain blitz ,then carry on :)


yes, it's warpy! | code | maths.

mm.. vm bitz(Posted 2002-03-28)
While helping zenith with blitgba (or whatever it turns out to be) I rewrote eval(), the maths expression evaluation function from my scriptign stuff. It's now stupidly fast :)
Then, as he was having trouble getting it to work, I made it output pseudo-asm, to show how it'd be done (I don't know real asm :P )
But, would the asm work? Only one way to find out - code a VM that runs it!
Now to test other bits, and create a compiler for a BASIC-type language, so I can see if there'd be any problems with my method.
Cue Compiler Generator(tm), Version the Second, New and Improved!

So, I've got the following process:
Put grammar.txt into compiler generator - this makes a compiler that converts an input pattern into one or more lines of output.
Feed input.bas into the compiler, this produces output.asm
Run output.asm in virtual machine. This works.

I am happy :)

If anyone's interested, I'll post the source for all this on my site..


yes, it's warpy! | code | maths.

Starting again on a script language(Posted 2002-03-06)
I've taken a look at Mark's blitz compiler code, and I *think* I understand the usefulness of tokenizers now :)
Anyway, I've got a cleverish script interpreter running, doing very basic stuff, and no expression evaluation, so you can do stoof like this:
let a.name="Bob"
print a.name
let poop=1
if poop then print "ak!" else print a.name

etc..
I'm going to stick this in the MUD when it's ready...


yes, it's warpy! | code | maths.

Making a MUD again...(Posted 2002-03-02)
..and this time it works! My FTP's down at the moment, so it's not available for useage (as if anyone would ever want it anyway..) but I'll get it up there as soon as I can.
The MUD's very basic, with no scripting stoof at the moment, with just object creation, container objects, openable objects, movement from one room to another, etc.
The good thing about this MUD is that all the commands are more or less plain English, so a typical action might look likt this:
create object #54 poo
set description for poo to A steaming pile of rotten manure.
drop poo
look around

etc...
Once I've got all the basic movement/interaction stoof sorted out, I'll get started on scripting.
Hmm...


yes, it's warpy! | code | maths.

HTTP serverage(Posted 2001-12-03)
a simple http server, it even does images (grudgingly.. might work, might not :P )

Gave up on the SVG parser, beziers work weirdly when several points are joined together... nothing to do with my algo, I checked :D
bbsvg.zip


yes, it's warpy! | code | maths.

In the Land of the Specs..(Posted 2001-11-22)
Some of you might know I'm working on an SVG parser/viewer, others don't. If you don't know what SVG is, check out the offficial page. Basically, SVG is the new open standard for vector graphics, from the W3C. It's XML-based, which makes parsing it exceptionally easy :)
Currently I've got all my XML parsing tools done, so at the moment I'm looking through the specs to see what I need to implement.
And what a lot of specs there are. 617 pages! If anyone knows of any shorter summaries of what you need to know, please [a mailto:webmaster@... me[/a], it'd help a lot :)
Anyway, I've got most of the rendering code done (apart from all those nasty splines and curves) and I've just got to write a CSS parser (which shouldn't be too hard) before this begins to look like an SVG viewer. I'm not exactly sure what I'll use this for yet, but it sounds like a useful thing to have.


yes, it's warpy! | code | maths.