måndag 12 april 2010

GET and POST

Now the Plankton Webserver also supports POST.

http://worldofcreeps.com:443/signin.plk

I have extended the plankton webserver with the creeps app, to run both the world and the webserver. The sign in and the creep list is therefore made directly in the running world, no serializations and sending of data over sockets as in the tomcat-servlet solution before.

creeps app - inherits plankton webserver
the creeps app starts the world in a new thread
the world takes a jtextarea (app output in the web server swing gui) as start argument and dumps all the output there.

So the current world actually runs in the plankton webserver environment since a couple of weeks.

måndag 15 februari 2010

Pools and Cache

This weekend I implemented a connection pool for the Plankton Webserver. I let a fixed number of threads start in the initialization and then leave them waiting for clients. Before I started a new connection thread whenever a client connected. This should be better for performance (not that it matters by now, but why not build it in from the start).

Before that I implemented a cache collection object. When a client requests a page, the connection will request it from the cache. If it's not in there, the cache will read it from file and save it in the collection. At this point all pages are kept in the cache, so that files would only have to be read once by the server. I will extend the cache functionality in the future though, calculating popularity, setting a max size etc.

Next i will build a special cache object for .plk pages. This object will keep the file content split up in a collection of WebParts, where the static content will be a new subclass of WebPart called StaticWebPart. This will minimize startup time for a new .plk page, because the page in the cache will already be parsed and ready for the load-method, the triggered event (if any) and the the rendering of the webparts collection.

fredag 22 januari 2010

Server Side Code

First try with a custom plankton app has succeeded. How to extend plankton and make your own server logic:

Start your java project. Include the plankton.jar library. In your app, import com.plankton.*. Create a new WebServer object. That's basically it. But that doesn't do anything more than running the plankton webserver on it's own.

To insert your own server logic - create a new class that extends com.plankton.WebPage, let's call it myapp.TestWebPage. Do something in the class, let's just write something to the page in the constructor of the class:

write("hello world");

Then, last step to attach it to a plk-file. Add the class reference to the initial <plk> node:

<plk template="template.html" class="myapp.TestWebPage">
... your design ...

Done. Run your app. Surf to your .plk page and the text "hello world" will be printed before any content in the file. My example here

http://worldofcreeps.com:443/plankton.plk

The text I wrote from my custom class is "I'm running the PlanktonTest!!!"

måndag 18 januari 2010

New Times

Nose To Nose

There has not been much development since the summer. I have my reasons. However, just recently I dusted off the old code. I have started to write a new webserver, for now called "Plankton". It is going to be a real lightweight and easy to start/use application for anyone who wants to run a small web without huge memory-and-process-consuming server applications, learning curve and tons of configuration options.

My thought is to also use Plankton for the World of Creeps, replacing the current tomcat/jsp setup. If this works as I intend, I will get rid of an application layer and in the same time make it much faster to develop since I won't be having the trouble with transferring live objects from one java-process to another (The running world -> Web app on tomcat). Web server and world will be the same running application.

The first test with Plankton v0.1b is running on port 443
http://worldofcreeps.com:443/

söndag 26 juli 2009

The Mail Problems

Well, it seems registrations has been working after all. The ISP may have shut down the account, but somehow the relay works. So I'll leave it for now. I guess I won't be able to read mail sent to the mail address, but it seems to work sending out info and that's what it's for...

tisdag 21 juli 2009

Always...

As always there is a problem when I leave home for a trip. This time my ISP shut down the mail account sending all creep mails. Reason, someone has hijacked it for sending spam. This means no one can register for now since I have an email confirmation on the registration. I talked to the support on the phone when I was on the airport, but it was a stupid drone who didn't know anything. When I'm back on Friday I will try to fix this.

Time for another pint. Over and out.

lördag 18 juli 2009

Vacation

Summer vacation is finally here. 4 weeks. If you want www.worldofcreeps.com to develop - wish for rain and cold weather in Sweden :)

First off is a trip to Scotland 20-24 Aug. A good test to see if all my architectural changes has made the world more stable. But if the world decides to take a rest, hold on until Friday, then it will be restarted.

fredag 17 juli 2009

New Creeps Bug

Apparently I missed one (or more) things when I introduced the new stuff yesterday. The activation of new creeps bugged out. I corrected that now, but that's probably the reason no new creeps have been born the last 24 hours.

Another small change that was made yesterday was that I now hide the "creeps in sight" on the creep info page. The list of creeps in sight is revealed with a mouse click now. On some creeps, in some parts of the world, the list was very very long and made it hard to see the history/action list beneath.

Change Alignment Scroll

Ok, the item development is now one step further in beta.

All gods have been given a change alignment scroll, that can be used three times.

If you didn't get one, just tell the almighty god.

Same goes for any bugs that may be caught when you try this out.

The scroll inverts the alignment of the creep you use it on. It can only be used on your own creeps. To use it, click "Use Item On Creep" from the creep info page.

torsdag 16 juli 2009

Stamina & Alignment

The latest creep stats that were introduced is stamina and alignment.

Neither of these play a role in the world yet.

At first stamina will be a parameter in the outcome of creep fights. Stamina will be possible to train and upgrade, just like strength and agility (and secret creep skills) today.

Alignment will also play a part in fights. Later on it will be used for creep professions as well.

Recent Changes Behind The Scenes

Some major structural changes has been made recently. The two most important were moving most of the log, and the opinions, into memory. Previously the log (all creep actions) and the creep opinions were fetched from the MySQL database. However, both these tables were becoming extremely large, and they were crashing more and more often (MyISAM). When I finally moved them to memory instead, the performance boost was fantastic. No more table crashes since this change. And the speed was improved many many times. Opinions and log state are now saved in .dat files instead, making world startup times very fast as well. Overall these changes has made the world much more stable.

The last change with opinions was a limitation. Opinions are growing at a very high rate when all creeps eventually will have opinions about all creeps (and gods). The limit now is that a creep's memory is not infinite. They will be able to remember a limited number of creeps - and when that memory is "full" they will forget the one they met the longest time ago. As for gods, there is no number limit, but a time limit. For now they forget gods after 6 months. Every touch will restart the 6 months period though.

Technical

Ok, a little something for the more advanced readers.

The world is set up on a windows machine (but I plan to move it to Linux).
The important information is stored in a MySQL database.
The world itself, is an application developed in Java.
Currently the world clock ticks every 5:th second.
The web interface is built in jsp / java and runs on Tomcat.
To get fresh information from the world, the interface connects through a socket and fetches real time data.
Both the world app and the web app (interface) uses the same jar file.
In order to present object (creeps, gods, regions, items..) information I have written my own serialization protocol and methods, to avoid overhead.
Dynamic images are constructed from svg originals. I have developed a new lightweight svg library in java to be able to accomplish this.

onsdag 15 juli 2009

Items

The big thing I'm working on right now is ... items.

Gods, Creeps, Regions... will have inventories. It's already up for beta with four creeps. The items in these cases doesn't do anything, they are just decorations.

Check out Gideon Jökul's star.

Items will be able to be wearable and equippable (for creeps). Eventually there will be a lot of different kind of items. However, the first item I will introduce will be a scroll, for all gods, that will be able to change creep alignment. Permanently.

Forum

I have been thinking about adding a forum to the site for quite a while. However, today I stumbled upon a thread discussing www.worldofcreeps.com.

http://www.virtualpetlist.com/forum/showthread.php?t=499

Quite nice to read about what total outsiders think about the world. They seem to think like me. It's a nice world, but the design needs a boost. So... who will help me? :)

What's This?

This is a blog about what happens in the World of Creeps (www.worldofcreeps.com). New features, work in progress, thoughts...

I know I have been very bad in updating the site with news, so I will try to use this tool instead to write about updates and what I'm working on.