Monday, May 26, 2014
Content Content Content!
Wednesday, May 21, 2014
Attack particle effects
Monday, May 19, 2014
Mining system
Resource gathering is an important part of every crafting system. An important resource would be ores and minerals mined from the depth of the earth.
It would, of course, be unthinkable for a wizard to take a pickaxe and perform manual labor to excavate minerals. Like everything in Pecosia, there is a branch of magic dedicated to these kinds of jobs: Geomancery.
Geomancery is the art of using magic to sense minerals in the earth and getting them to the surface. A geomancer hunting for ores needs two spells: A detection spell which tells him where the minerals are hiding and a mining-spell which gets them to the surface. More advanced minerals do of course require more advanced geomancery spells to find and mine.
Detection spells:
Prospect
The first spell cast by a geomancer visiting a new location. It tells them if and which minerals can be found on this map, but not where.Probe
Tells the geomancer if there are mineral deposits in range and how far they are away, but not in which direction. It does so by telling the caster the level of mineral radiation at its current position. The closer they are, the higher the radiation. However, when there are multiple deposits in range, their radiation adds up which could mislead the geomancer.
Sense
Tells the geomancer the direction of the next mineral deposit, but not how close it is. When there are multiple deposits nearby, the vector-product is created and the angle of that is shown, so again, multiple deposits in range can be misleading.
The Mining spell
When the geomancer believes that she found the deposit, she will use the mine-spell. It will reveal any mineral deposits in range and turn them into items which can then be picked up. The mine-spell is much more MP-costly and slower to cast than the detection spells. So while a geomancer which just casts it randomly might find a deposit once in a while, one which uses probe and sense will be much more successful in the long run.
All of this should not be hard to implement. But before I start I need to work on some bugs. I am using a spreadsheet for a while to collect any bugs I find but do not feel like fixing right away, and it has grown quite long. Some are of the we-can-live-with-that-for-now level, but there is also a very critical bug which makes the whole network system unresponsive under some condition which I definitely need to take care of before starting with any new features. There are also some worrysome bugs which are not that critical, but very hard to reproduce. Multithreading is hell.
Saturday, May 3, 2014
Fighting NPCs
I added the ability for NPC scrips to turn NPCs into mobs and revert them back to NPCs when defeated. This will be very useful for quest scripting. I want to avoid those cliché "Kill 10 rats" quests. I want quests which actually tell a story and are not just excuses for mob grinding.
I also did a first quest where you retrieve a stolen item. The player finds the thief and talks to them. Then the thief turns hostile and fights the player. Well, that's the basic plot. The details are of course much more fleshed out (don't want to spoil).
Saturday, April 26, 2014
Shutdown procedure
Until now there was no proper way to shut down the server. The only way was to kill the JVM process, which didn't save any characters. I finally solved this by adding a proper shutdown-command which properly disconnects and saves all the characters, terminates all the map instances and properly finishes up all the other stuff which happens in the background. I also wrote a server-sided javascript which can be executed from the shell and shuts down the server after a countdown. This utilizes a new admin-broadcast feature I also implemented.
I mostly did the script as a PoC for server-sided scripts started from the console. This might come in really handy for special events managed by GMs.
Saturday, April 12, 2014
Choosing a wiki software
My should-requirements are:
- Uses PHP
- Simple to set up and administrate
- Syntax similar to MediaWiki
- Doesn't use databases besides MySQL and MongoDB
My can-requirements are:
- Possible to hack in a way that it can share user accounts with my game
MediaWiki
My first idea was the popular MediaWiki, but the "What is MediaWiki" section on their homepage says:"MediaWiki is geared towards the needs of the Wikimedia Foundation. The program is primarily developed to run on a large server farm for Wikipedia and its sister projects. Features, performance, configurability, ease-of-use, etc are designed in this light; if your needs are radically different the software might not be appropriate for you."
I just want a wiki for my small little game, not build a million-article encyclopedia running on a dedicated server-farm, so this doesn't really sound like the right software for me.
PmWiki
The second software which caught my eye was PmWiki, pretty much the Anti-MediaWiki.It is extremely simple to set up, because it doesn't even require a database. It saves everything in flatfiles. This might look strange in this day and age, but they are making a convincing argument. I tried it and the installation was indeed a breeze - just copy the PHP-files and it runs out-of-the-box.
But what really surprised me is that PmWiki by default does not even know the concept of personalized user accounts. In the default configuration, everything can be edited anonymously. When you don't like that, you can set individual passwords, but they are not bound to accounts. Anyone who knows the password can read or edit specifically protected pages.
There are, however, lots of addons which enable mandatory logins with username and password. Many of them are designed to use the user databases of other systems. That likely means that I could write my own which uses the accounts in my MongoDB.
Wednesday, April 9, 2014
MongoDB authentication
Sunday, April 6, 2014
Password changing
Thursday, March 27, 2014
Crafting interface implemented
I added support for crafting. NPCs can now display a crafting window. They can freely define how many slots to display and where to display them. The item script can also define a handler-function which receives the items the player dragged into the window. Each slot can define a "tag" which says which items can go there. Items can now have one or more such tags which define the crafting use they have.
The Java part of the engine does the ground-work of validating that the users input is legal (tags match the slots, user actually has the items).
The scripted function is then responsible for checking if the combination is a valid recipe, remove the items and give the player a new item. This function could also be implemented as a Java class. When I develop a more complex crafting system, I might opt to do so.
Java 8
I updated to Java8 and experimented with some of its new features. I coverted the admin command handlers to use the new lambda feature, and it really improves the code. The new Nashorn Javascript engine gave me some problems because some scripts no longer worked the way they used to, but I think I solved all the issues (wrote a Q&A on stackoverflow about it).




