🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rec.games.programmer
Article #27

ap formats - I need h

#27
From: colin buckley
Date: Thu, 29 Oct 1992 08:11
69 lines
3504 bytes
Date Entered: 10-29-92 03:03
  >It just seems that any time someone descends into a new place i either
  >generate alot of waste or lot of headache.

BA>        So any of you ever write or come close to finishing an Ultima/Tile
  >type game? Where did you guys have problems?
  >        Any help would be appreciated. Maybe I'll just go back to the
  >assembler sprite routines....
  >                                                - baylor


BA>        Specifically, If i have a routine DrawMap (Var Map : MapType)
  >then EVERY map has to be the same size!!!
  >        In ultima (Vampyr is better i think) you can go in castles that
  >are small, houses that are tiny, and the world map which is huge.
  >        Would I do something like
  >var
  >        WorldMap,House1,Castle1,House2,Cave1,etc  : MapType;

The problem with his approach is TP only offers 64K for global variables,
and you're going to eat it all up in no time with that sort of approach.

BA>Keep several MapTypes (diff sized arrays) and seperate procedures to
  >display them?

Why not use something like DrawMap(Width,Height:Word; Var Map:MapType)
but make MapType=^Array[0..0,0..0] of Byte; You'd have to GetMem your Maps
but you'd still have indexed access and you'd be using the heap and not
the data segment.  Now you have variable lengthed arrays which will cause
a couple of headaches it's self.

NOTE: I have never tried to typecast a point to a 2D array.  And I believe
you'll have to disable Range Checking when accessing the array.  The Optimal
solution is to write your DrawMap in BASM and just use Map:Pointer, you can
figure out using Width and Height how the memory used by Map is organized.

NOTE AGAIN: If you use BASM use DrawMap(Width,Height:Word; Map:LongInt);
and call it like DrawMap(10,5,LongInt(Map)); where Map is actually declared
as a pointer.  Otherwise BASM won't let you LDS SI,Map for some reason.

I personally use DrawTiles(Tiles:TilesInfo); where

TilesInfo=Record
  X,Y:Word;
  MapWidth,MapHeight:Word;
  Map:Pointer;
End

to save all those variable stack pushes.

Anyways, just some ideas...

Say did you ever figure out your PACMAN problems?  I gave it a run but
never actually looked at the source.  The main problem seemed to be
that Black was the top rainbow colour and white was the bottom colour,
and when a vertical pass was made using the horizontal rainbow, the black
and white left the trail.  Just make a vertical rainbow for vertical passes
or restamp the rainbow every 16 pixels PACMAN has already passed.  1st method
is easier and better.
.----------------------------------------------------.
| Colin Buckley -- 486 Powered (Packing Extra Socks) |
| Toronto, Ontario, Canada                           |
| InterNet: colin.buckley@rose.com                   |
|                                                    |
| So Eager to Play, So Relunctant to Admit it...     |
`----------------------------------------------------'
---
   RM 2.00 : RoseNet<=>Usenet Gateway : Rose Media 416-733-2285
Technical Details
Message-ID: <1992Oct29.081152.10135@rose.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uunet.ca!rose!usenet

Show Full Headers
Complete Article Headers
Newsgroups: rec.games.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uunet.ca!rose!usenet
From: colin.buckley@rose.com (colin buckley)
Subject: ap formats - I need h
Organization: Rose Media Inc, Toronto, Ontario.
Date: Thu, 29 Oct 1992 08:11:50 GMT
Message-ID: <1992Oct29.081152.10135@rose.com>
Sender: usenet@rose.com (Usenet Gateway)
X-Gated-By: Usenet <==> RoseMail Gateway (v1.70)
Lines: 69