Archive

Posts Tagged ‘code’

C# Cartesian Point class

May 4th, 2010 Dave No comments

Source: Kharne

I've developed a class for using Points in C# (unlike Delphi, there's no inbuilt type). You can grab the source code and a sample console app here or here. All code is public domain, knock yourself out, etc, etc, etc.

First batch of changes for v0.05c uploaded to the repository

April 17th, 2010 Dave No comments

Source: Kharne

I've uploaded the first batch of changes to the code for the next version to the online source-code repository. Fixes & Updates completed in the code so far are:
  • Some monsters now follow characters up and down stairs.
  • Classes now have different titles, dependent upon current character level.
  • Only the just finished game will be now highlighted correctly in the hiscore list after character death.
  • Spurious double quotes (") will no longer appear in automatically generated character names.
  • When resting, there is chance of a monster appearing randomly near the character.
  • Eating now restores all lost health points.
  • When starting a 2nd game in the same session, the Character Background will be reset properly.
  • On Character death, the Main Window Title will be reset properly.
  • Elemental Intrusion Creatures no longer have as many hitpoints.
  • Unidentified Scrolls are now identified properly on Character Death.
I'll not produce an executable release for these, but I'll wait until the other changes (including potions!) are finished before releasing the next version (some of them are incomplete in the code but don't affect compilation).

You are of course welcome to download and compile the latest version if you are in a position to do so.
Categories: Kharne, Planet Roguelike Tags:

Configuring and compiling Kharne – a brief guide

October 13th, 2009 Dave No comments

Source: Kharne

(this is a copy of CODING.TXT which is found in the source code distribution. I will also add a permalink to this post for reference purposes)

Contents:
  1. Introduction
  2. Required 3rd Party Components
  3. Licensing Notes
  4. Other Notes
  5. Contact Details
1. Introduction

Welcome to Kharne. Kharne is a standard Delphi Windows application that uses a certain number of third-party controls and libraries for additional functionality above and beyond that provided in Delphi.

I have developed Kharne using Delphi 7, but provided the external controls can be installed, it should be compilable in any version of Delphi newer than 5.

2. Required 3rd Party Components

Due to licensing terms, I can't provide these components or distribute their source with my own distribution.

You will need to download and install the following before you open the source in Delphi for the first time:

a. TGradLabel
http://www.delphi32.com/vcl/929/#

It is my intention to phase the use of this component out entirely.

b. TAStarPathPlanneer
http://www.riversoftavg.com/tastarpathplanner.htm

c. TQProgressBat
http://mapage.noos.fr/qnno/pages/delphi_en.htm#TQProgressBar

d. TSQLLite
http://www.itwriting.com/blog/a-simple-delphi-wrapper-for-sqlite-3

You may need to add the path of this component to the Project Search Paths.

e. THotLog
http://mapage.noos.fr/qnno/pages/delphi_en.htm#hotLog

This isn't a component as such, simply copy hotlog.pas into the source directoy and make sure it is added to the project.

f. TKeyboardHandler

As this is no longer available *anywhere* on the web, I've included the source in the components subdirectory. Longer term I want to phase use of this component out and duplicate its functionality,

g. sqlite3.dll

This is the SQLLite interface library, is public domain and thus is included with this source distribution.

If any of these components become unavailable, contact me (starbog@gmail.com) and I will send them to you direct (I will only do this under these circumstances). I will then try and remove any dependency upon them from the next version.


3. Licensing Notes

I have released Kharne under the MPL as opposed to the GPL because I'm not convinced that the latter allows a Delphi program to link with components that are not GPL themselves.

I've had a reply direct from the FSF telling me that it does provided I add an additional disclaimer to the GPL License that gives explicit permission. However, as I'm not convinced about this (the GPL itself is quite fuzzy in this regard), I'm releasing Kharne under the MPL to avoid any doubt.

However, just to clear things up, I'm am granting an irrevocable right to link my code released under the MPL to any other custom component, library or API no matter what the license.

The source code file UnitOtherFuncs uses a few small routines freely available on the web - I have indicated carefully what these are in the source and their origins, and this file is obviously not released under the MPL.

The distribution also includes a copy of the Bitstream Vera Sans Mono Font (veramono.ttf) which can be freely distributed and is in the public domain. If you are doing development, please copy this and install it in the usual way before opening the source code.

4. Other Notes

I have no idea if Kharne will compile with Lazarus, I suspect the custom components may prove to be an unsurmountable obstacle, but anyone is welcome to try porting if they wish. I'd like Kharne to run multiplatform without using WINE, but that may have to wait until cross-compiling for Delphi becomes a reality (it has been promised for the version due out in 2010.)


5. Contact Details

I can be emailed direct at starbog@gmail.com or reached via the blog at kharne-rl.blogspot.com. Or you can reach me on #rgrd regularily where I am known as "starbog".
Categories: Kharne, Planet Roguelike Tags: ,

Automatic notifications of commits

October 11th, 2009 Dave No comments

Source: Kharne

Does anyone know of a way to automatically post a message to a blog with summary details of a commit that's been made to a Googlecode SVN? (but not the email that's generated with all the changes)

Kharne source code repository now on GoogleCode

October 4th, 2009 Dave No comments

Source: Kharne

The Kharne sourcecode is now on GoogleCode.

Source Code Issues #1

October 3rd, 2009 Dave No comments

Source: Kharne

dunkel^ on #rgrd has discovered a couple of gotchas with the current source code distribution that prevent compilation.

In the uses clause in the interface section of UnitDisplay.pas (line #33) I left an errant reference to a component I no longer use. If you remove BtChkBox from this clause, it solves this problem.

The new uses clause should look like this:

uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, KeyboardHandler, DateUtils, jpeg, ImgList, Menus, ComCtrls, ToolWin, Gradlabl, PathPlanner, QProgBar, AppEvnts, hotlog, UnitDungeon, UnitDefines, UnitConst, UnitVars, UnitFunctions, UnitItem, UnitCreature, UnitMonster, UnitInit, UnitGame;

Also, the logging component, THotLog seems to be unreliable and AVs a lot. To disable it for now, just comment out the hLog.StartLogging call in the TFormSplash.FormCreate method in UnitSplash.pas (line #66):

{ Form Create }
procedure TFormSplash.FormCreate(Sender: TObject);
begin
{ Set up Logging }
hLog.hlWriter.hlFileDef.append := False;

{ Start Logging }
//hLog.StartLogging;

{ log System Information}
hLog.add('{OSVI}');
hLog.add('{CPUI}');
hLog.add('{mem}');

With these changes, Kharne was able to be compiled and ran successfully.
Categories: Kharne, Planet Roguelike Tags:

Kharne 0.05 and source code released!

October 2nd, 2009 Perdurabo Nihil No comments

Source: Kharne

Kharne Alpha v0.05 is now available, and has been released as open source under the MPL v1.1

This version is functionally identical to v0.04a.

The source code is available here or via the downloads menu.

Please read CODING.TXT in the docs subdirectory before attempting to load the Kharne project into Delphi.

If you have any questions, or difficulty getting the source to compile, feel free to leave a comment here or email me on starbog@gmail.com.

7DRL Winner’s Circle

March 17th, 2009 Legend of Angband No comments

Source: Legend of Angband

The results of the Seven Day Roguelike Challenge for this year have been announced. There were a total of 45 challengers (myself included). Of those, 25 were winners. My entry dL1 was listed in the winner's circle. To the left is the challenge medal for this years winners.

It is not impossible to win the 7DRL challenge. You only have one week to code up a game. That part is difficult. But to win you just need to produce a rogue-like game that works and is playable within the week long time period. Don't get me wrong. That is no trivial task. However if you set realistic goals, you can achieve success.

I wonder if I will be around next year to enter again. It is my hope that I would have gained more Java programming skills. Perhaps it is time to study up on different things like level generators, lighting, and monster AI to be prepared. It is all good fun.

Meanderings

January 10th, 2009 Snut No comments

Source: The Oblong


The festive season never seems to be a good time to get any coding done...

With that out of the way, I'm going to press on with my crazy schemes. Over the past few days, I've been trying to recreate the skeleton of my game in Haskell using Nanocurses (this was mostly an excuse to learn Haskell, having tried and failed many, many times already).

I still think in altogether too imperative a fashion for Haskell to look on approvingly, especially when doing things with Curses involves slipping into 'do' notation all the time. Ah well, it'll be interesting to see if rendering my problem in a more pure language will help me spot any solutions.

Whoops, massive lack of updates

October 7th, 2008 Snut No comments

Source: The Oblong

So, many deadlines at work combine with a resurgence of my WoW habit to completely destroy my hobby-code productivity...

With the next expansion looming very near (and a pre-expansion patch apparently within a week), Wowcrack is undergoing some very bizarre changes. I may splurge about the design decisions later, because they're quite interesting even if mostly specific to the online genre.

In the past month I did get a few things done. Some general hackery, a new model to replace the tentacles for general clutter, and a starter particle system (here used to show where the test lights are):



Particles are entirely GPU-side, all the simulation is done in the vertex shader operating on some static random buffers. This means they're only good for simple things, but they're pretty damn quick, entirely deterministic, and quite fun.

'Shrooms need a diffuse texture, and probably a redesign. The problem with things like these familiar mushroom shapes is that from a top-down perspective, they look a great deal like rocks. Bright colours/spots/etc would help with that, but I think a better choice would be to choose a more interesting shape for the fungi and flora. After all, they're present in a vast array of bizarre shapes in real life, so I see no reason to stick with the common toadstool shape in a fantasy cave-world.

With luck, I'll have more time for code and blogging soon. 'Til then, enjoy the minimal sparklies!

Edit: SSAO is turned off in the final composited image at the moment, because it has returned to looking a bit arse. Tricky thing to get right it seems.