Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Perdurabo

Pages: 1 2 3 [4] 5 6 7
46
Programming / Re: Kharne Alpha 1 Available
« on: October 03, 2009, 11:20:41 PM »
I've set up a googlecode SVN:

http://code.google.com/p/kharne/source/browse/

47
Programming / Re: Map Generation / Tile definition?
« on: October 03, 2009, 11:19:54 PM »
Although I think an array of a small class is the best solution, I usually just end up using an array of integers. Something like:

int map[80][25][3];

With the 3rd dimension being: 0 - Character 1 - Type (Usually just wall/floor) 2 - Misc (color, seen before, etc.). But really, I've regretted doing this in every long term project I've done it in. It's much more convenient to use a class.

I go with Elig here - arrays are much handier to use. In Kharne, I have the following:

  { Map Layer Definitions }
  Visible: array[1..DUNGEONSIZEX, 1..DUNGEONSIZEY] of integer;
  Terrain: array [1..DUNGEONSIZEX, 1..DUNGEONSIZEY] of integer;
  Effects: array[1..DUNGEONSIZEX, 1..DUNGEONSIZEY] of integer;
  Objects: array [1..DUNGEONSIZEX, 1..DUNGEONSIZEY] of integer;
  Zone: array [1..DUNGEONSIZEX, 1..DUNGEONSIZEY] of integer;
  Monsters: array [1..DUNGEONSIZEX, 1..DUNGEONSIZEY] of integer;
  Walkable: array [1..DUNGEONSIZEX, 1..DUNGEONSIZEY] of boolean;
  People: array[1..DUNGEONSIZEX, 1..DUNGEONSIZEY] of integer;
  TerrainCost: array[1..DUNGEONSIZEX, 1..DUNGEONSIZEY] of integer;



48
Programming / Re: Kharne Alpha 1 Available
« on: October 01, 2009, 11:08:01 PM »
Ok, Kharne is now officially open-source.

v0.0.5 has been released, and the source is also available under the MPL.

Details at: http://kharne-rl.blogspot.com/2009/10/kharne-005-and-source-code-released.html

49
Programming / Re: Kharne Alpha 1 Available
« on: October 01, 2009, 01:22:08 PM »
Just gotta keep at it bit by bit until it looks about right to ya.  Perhaps some other Delphi folk will pop around once it is up and illuminate some bits on it.

Hopefully!

Eventually, I do want it to be cross-compilable with minimum effort on Lazarus/FPC.

50
Programming / Re: Kharne Alpha 1 Available
« on: October 01, 2009, 12:25:21 PM »
Heh. That's probably deeply worrying...I still think the code, even after the refactor, is sub-optimal in many places.

I've just written the instructions for compiling that will accompany the source code so the only thing left to do is package and release it onto googlecode

And then I've got to look into setting up a repository and so on.

51
Programming / Re: Kharne Alpha 1 Available
« on: September 30, 2009, 11:19:37 PM »
Yeah, source was never released, as far as I can tell.

Best,
P.

52
Programming / Re: Kharne Alpha 1 Available
« on: September 30, 2009, 02:21:30 PM »
Just a quick heads-up that the source code for the current alpha of Kharne will be released under the MPL in less than a week's time. I've finished the giant code refactor of doom that I was carrying out and as soon as I write up instructions for installing the necessary APIs and 3rd party VCL components that Kharne uses, I'll put the code up on Googlecode and put a message here.

As far as I'm aware, there aren't many other roguelikes out there written in Delphi and I've never come across the source code of any, so if you're interested in Delphi or even FreePascal check it out.

And then, onwards and upwards!

Best,
P.

53
Programming / Re: Kharne Alpha 1 Available
« on: September 27, 2009, 10:35:45 PM »
Two versions out the door. 0.0.4 and 0.0.4a:

0.0.4 changes:

* Character Creation functionality has now been incorporated into the main window and no longer uses an external DLL.
* The inventory screen has been redesigned.
* Multidrop functionality via the keyboard has been implemented (press 'd').
* Eating functionality via the keyboard has been implemented (press 'e')
* Added PseudoIDing of items held in the inventory for a certain amount of time.
* Added key summaries to the bottom of each subscreen.
* Monsters have had their hit points and damage increased.
* The application should now exit correctly and not hang around in memory.
* Upon levelling, two appropriate skill categeories for each class are now increased by 1.
* The chance of cursed items appearing has been more than doubled.
* Added an item view to display detailed item information from the inventory.
* Characters that do not know any magic can no longer access the spell screen.
* The character dump now displays the monster kills for the character.
* Monsters that have special plurals should now be referred to correctly in the plural form.
* Fixed a few minor spelling mistakes in the character dump and a few layout mistakes on the high-score screen.
* Female characters should no longer be referred to as "he" in the character dump.
* When digging a reminder is now displayed of the keys used.
* Drinking from fountains now uses a turn up.
* Monsters in zones are now scaled more appropriately.
* Not wearing any armour at all will significantly increase the rate at which the defense skill is learned.
* The character 'back' slot which was never used in game has been removed.
* Sneak attacks are now flagged in the message log.
* Thieves now get extra sneak-attack damage when using ranged weapons.
* The thievery skill now grants a chance to open and close doors without allowing monsters to react.
* Monsters that are carrying items no longer have their items disappear on death when killed in ranged combat.
* The change in 0.03 to not display messages upon opening and closing doors has been reversed.
* Trying to open or close doors when there are no doors in range will produce an appropriate message in the message log.
* Opening doors as part of movement will now cause a turn to pass.
* Tunnelling now takes only half as long.
* Tunnelling now displays a message indicating if it has been aborted due to nearby monsters.
* Attempting to tunnel through impassable walls now doesn't use up any time.
* Trying to dig on the town level results in a warning message.
* Walking into walls now uses up a turn.
* The rate at which subterfuge skills are learned has been dramatically increased.
* The rate at which ranged combat skill is learned has been dramatically increased.
* Trying to pick up an item with a full inventory no longer gives the message that an item has been successfully picked up.
* The message log now reports that Undead monsters are 'destroyed'and Outsider creatures are 'banished' instead of 'killed'.
* Identified items that are cursed now have 'Cursed' as an integral part of their name, e.g. they are called "A Cursed Longbow [-1,-1]" instead of "A Longbow [1, -1] (Cursed)".
* Unidentified artifacts have now the correct prefix in their name.
* Fixed a bug where an error would occur when trying to write a Hiscore to the HiScore table if the table was empty.
* Special terrain tiles are now described correctly inside an elemental invasion zone.


and 0.0.4a changes:

* Blocked repetitive keypressing whilst in character creation to avoid selecting multiple options with the same keypress.
* The various character creation steps can now be undone.
* Pressing [CTRL] on the background tab in character creation will now generate a random background.
* Half-Orcs are now Orcs everywhere in the game.
* Character Dumps should no longer report dwarven characters as halfings.
* Character files which belong to characters who have died are now moved to the morgue subdirectory.
* Upon death, a copy of the character dump is written to to the morgue subdirectory.
* Common items can now be pseudo-ided.
* Fixed a minor spacing error in automatically generated backgrounds.


Some of the 0.0.4a changes were made in direct response to comments on the blog, so I am reading them and this thread.

Now I've got this out of the way, I'm going to have to start on potions and scrolls, magic and saving and loading.

54
Traditional Roguelikes (Turn Based) / Re: Grendel's Mother released!
« on: September 24, 2009, 05:44:36 PM »
I started this earlier today, trying to make a <1/2KBRL. I didn't succeed. By the time I was done, I had a roguelike which took 7 and a half hours, and was 4.4KB in source code size. So it's a <5KBRL which is just as fine with me. Since it was done in 7 and a half hours, it's also an 8HRL I suppose.

It's pretty simple, you are Beowulf, diving through Grendel's lake to kill Grendel's mother at the bottom. You have a limited amount of health, and there is no leveling. The goal is to reach the bottom of the lake (Level 8 ) and kill Grendel's mother. Pretty simple, but it has a nice dungeon generator. I'm happy with it!

It's only story is various text quoted from Beowulf.

You can download it here:
http://code.google.com/p/dreamhack/downloads/list

I can't run it because I get an error. In the event log, its:

"Activation context generation failed for "C:\roguelikes\GrendelsMother\GrendelsMother.exe". Dependent Assembly Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50608.0" could not be found. Please use sxstrace.exe for detailed diagnosis."

I'm running Vista.

Best,
P.

55
Programming / Re: NLarn - a Larn remake
« on: September 20, 2009, 04:56:02 PM »
That looks beautiful

56
Programming / Re: Kharne Alpha 1 Available
« on: September 15, 2009, 03:15:36 PM »
Another bug fix/incremental version out - 0.03d

http://kharne-rl.blogspot.com/2009/09/kharne-003d-available.html

List of changes:

    * Bitstream Vera Sans Mono is now the only font used throughout the entire game.
    * Ranged/magical attacks for monsters now use differening appropriate and meaningful ASCII symbols.
    * Ranged/magical attacks for monsters now are described correctly (and differently from melee attacks).
    * The status/info panel can now be hidden (F1/F2 to toggle).
    * Grammar and punctuation has been corrected in various locations throughout the game.
    * The Monster description window has been removed from the game.
    * The Item popup window has been removed from the game.
    * OOD Monsters and Uniques have had their stats adjusted.
    * Wearing and removing magical items now produce additional atmospheric messages.
    * The magnitudes of item enchantments have been modified.
    * Attacking with a missile weapon now produces appropriate feedback in the message log.
    * Monsters that haven't detected the player yet are grayed-out.
    * Monsters can no longer critically hit the player.
    * Skill levels now contribute to Game Score.


I'm going to have to start adding new features soon (i.e. potions/scrolls/magic) but I've been too busy with my part-time degree recently.

Best,
P.

57
Programming / Re: Inventory
« on: September 15, 2009, 03:01:57 PM »
Yet another option: don't use classes at all, use a set of structs for each item type, and a super-struct that contains a simple id flag, and a union of each struct type. The amount of memory you take up in the union will be the amount the of the largest struct.

I use classes, but effectively that's what I use in Kharne.

TItem subclasses from TItemArchetype

with the added restriction that TItem is actually an instantiation of TItemArchetype.

58
Programming / Re: Kharne Alpha 1 Available
« on: August 07, 2009, 09:02:11 PM »
0.03c is out.

Full info at: http://kharne-rl.blogspot.com/2009/08/kharne-003c-available.html

Changes in this version:

* Added milestones to the Character Log.
* Multiple Items can now exist on the same square.
* Firing a ranged combat weapon now correctly updates the turn count.
* The maximum damage a monster can do to a player in a single hit is now (Maximum Hit Points - 1).
* Piles of Silver and Bronze can now be found throughout the dungeons.
* Items have been reduced in cost by a factor of five.
* There is now a wider variety of entry vaults.
* Amulets can now be found in fountains.
* Combat Text is now much more descriptive.
* Monster attacks that hit you and cause damage are now displayed in a different colour.
* Co-ordinates are now only displayed if the Wizard Window is displayed.
* The number of hit points and magic points gained per level has been slightly increased.
* The effect on speed of carrying weights greater than maximum load has been reduced slightly.
* Monsters will use ranged attacks less often.

59
Programming / Re: Handling Transient Events and Effects: an example
« on: August 07, 2009, 12:20:32 PM »
I assume that DURATION_MIGHT_POTION is either an even number from 2 to 100, or an odd number between 51 and 199, since otherwise MightPotionTick might be called not exactly once... That's very bug-prone.

Sorry, I don't understand exactly what you mean.


I just found another bug... in MightPotionTick, you probably want to call "Player.Strength := Player.Strength - 5" only if DrinkMightPotionEvent.Progress = 50?

Suppose that yes, and that DURATION_MIGHT_POTION is 35, then MightPotionTick will be called for the following values of progress: 0 2 5 8 11 14 17 20 22 25 28 31 34 37 40 42 45 48 51 54 57 60 62 65 68 71 74 77 80 82 85 88 91 94 97 100. That means that Progress will never be 50, and player strength will never be reduced by 5 by that method, thus the player will have his strength permanently increased by 5 after drinking the potion.

And if DURATION_MIGHT_POTION is, say, 200, then he will have his strength permanently decreased by 5. The problem is with low granulaties. Sorry if I misunderstood something.


Ah right, yes.

You are completely correct.

The progress mechanism is horrid, isn't it?

Someone else flagged this up as well:

http://groups.google.co.uk/group/rec.games.roguelike.development/msg/c83d1c9b31bf0ff1

In reality, to get around the strength thing, I think I'd only ever manipulate a "temporary strength pool" (Player.Strength is a calculated attribute and this temporary additional strength pool is one factor that makes up the strength, and it would normally be 0).

I think what I need to do instead of an atomic progress attribute is to capture the transitions between specified thresholds.

For example, if you define a threshhold event at 50% then as soon as the tick drops progress from 50%+ to <=50% then the event occurs.

60
Programming / Re: Handling Transient Events and Effects: an example
« on: August 07, 2009, 10:44:49 AM »
I assume that DURATION_MIGHT_POTION is either an even number from 2 to 100, or an odd number between 51 and 199, since otherwise MightPotionTick might be called not exactly once... That's very bug-prone.

Sorry, I don't understand exactly what you mean.

I do think however I need to post-decrement the tick after the tick event instead of pre-decrementing it (as I'm doing now):


  { Trigger events if they are defined }
  if (FTimerDurationLeft > 0) then
  begin
    { Interval Event }
    if (Assigned(FTimerTickEvent)) then
      FTimerTickEvent(FTimerDurationLeft);
  end
  else if (FTimerDurationLeft = 0) then
  begin
    { End Event }
    if (Assigned(FTimerEndEvent)) then
      FTimerEndEvent(FTimerDurationLeft);
  end;

  { Decrement the Timer }
  Dec(FTimerDurationLeft);

  { Return true if the Timer is still active }
  Result := GetStatus;


This means now that with an event of duration of one turn, you get the start event (at 1 turn), a single tick (from 1->0 turns) and then the end event (at 0 turns).

Why give the events the parameter 'turns' if you are then accessing the original timer object instead of using this parameter?

I'm not - turns in the Events is the parameter passed in - the Events currently don't know anything about the timer object (Turns was a "let's just stick a parameter in here to show that it works" thing).

I'm going to change this however a pointer back to the original calling event. That way a global "drink" start event, for example, could be used for all potion types (see below).

What if the player drinks a new potion of might while the old one was still active? It seems hard to do correctly in your current way. If you don't implement this case specially, the strength bonus of the old one will remain in action forever.

True. However, and its my fault for not expressing this more clearly (or at all, even), I'm intending to store active Timers in a TObjectList, and the add method will have gatekeeping added to it so that only one Timer of type timMight can be active at any one time.

I don't think that the abstraction of timer you did is helpful in this case at all. Your implementation of the potion of might is not simpler than just having a MightTimer:integer property, which is decreased on each turn (if >0), increased on drinking, and a method called on each change (note that this implementation would also be better because the problem with drinking multiple potions it solved more easily).

If you now want to create a Potion of Agility, you will have to repeat a lot of functionality, and in many places. Abstraction is helpful if it makes doing many similar things easier and without repetitions, and I think this goal is not achieved in this case.

It was a poor example I used (for which I apologise). As mentioned above, I don't indent to have seperate MightEvents, AgilityEvents and so on, but use one global timer handling event for potions instead, especially if I pass in the Event Object itself which can be subsequently be used in a case statement to determine what to do.

Instead of

Code: [Select]
begin
  Percentage := FTimerDurationLeft / FTimerDuration;
  Result := Trunc(Percentage * 100);
end;

why not just Result := (FTimeDurationLeft * 100) div FTimerDuration? You don't need doubles for this calculation...


True. I was being particularily dense.

The problem with the Progress property is that its useless at low granularities, however. If you had an event with a duration of seven turns you end up with the percentages returned being the equivalent of 1/7, 2/7 etc, i.e. not very nice round numbers.

Pages: 1 2 3 [4] 5 6 7