Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 3 4 [5] 6 7 ... 11   Go Down

Author Topic: Hacking: Open Contribution Thread  (Read 76492 times)

0 Members and 3 Guests are viewing this topic.

murlock

  • Chaos Wizard
  • A600
  • *
  • Karma: 2
  • Offline Offline
  • Gender: Male
  • Posts: 34
Re: Hacking: Open Contribution Thread
« Reply #60 on: August 18, 2011, 01:04:46 AM »

Hey There,

Since I completed the data disk, haven't had much time into refining this.

I need to refactor the code somewhat to make it a bit more understandable and modular. But then I would have no problem with posting code snippets to assist in demostrating logic.

Cheers
Logged
Look to the towers my friend

MadMunky

  • Forum Mod
  • A600
  • *****
  • Karma: 2
  • Offline Offline
  • Gender: Male
  • Posts: 244
Re: Hacking: Open Contribution Thread
« Reply #61 on: August 20, 2011, 09:53:54 AM »

That would be good, as a newbie to programming I was interested how you read the file as a binary and how you do drawing off the map.

Also Have you thought about doing a process hook so you can read/write the data in realtime? I managed to do this using cheatengine (http://www.cheatengine.org/) but wanted to be able to make a map editor and character editor in VB
Logged

murlock

  • Chaos Wizard
  • A600
  • *
  • Karma: 2
  • Offline Offline
  • Gender: Male
  • Posts: 34
Re: Hacking: Open Contribution Thread
« Reply #62 on: September 18, 2011, 12:52:31 PM »

Hey, this site is back up :)

For reading binary, basically I read the file as a list of bytes and just accessed that list based off the known offsets.

For drawing the map, I'm just using some rudimentary system.drawing logic, not very efficient but does the trick. ;)

Unfortunately my time is incredibly limited at present, so may not be able to do much further work until near the end of year :(
Logged
Look to the towers my friend

MadMunky

  • Forum Mod
  • A600
  • *****
  • Karma: 2
  • Offline Offline
  • Gender: Male
  • Posts: 244
Re: Hacking: Open Contribution Thread
« Reply #63 on: February 11, 2012, 02:09:39 PM »

Murlock,

Did you do any more work on this?
Logged

MadMunky

  • Forum Mod
  • A600
  • *****
  • Karma: 2
  • Offline Offline
  • Gender: Male
  • Posts: 244
Re: Hacking: Open Contribution Thread
« Reply #64 on: May 21, 2012, 03:29:44 PM »

Well I've finally started work on my own stuff as I have never programmed or done 3D stuff progress is slow but what im doing is a Map Editor/Viewer which supported Bloodwych Files see below



I cant work out how the orientation of the Wooden Walls/Doors is done yet but will look into that as its only a start (if anyone can help me out with this they are more than welcome). I've also started to write a Bloodwych remake engine the plan is to be able to support the Bloodwych map files and also my own type based on these I only started this a couple of days ago but progress is going alright im focusing on getting the engine to look right and have multiplayer support (local and network) so when your playing via the network its still split screen updating the window below like Bloodwych was when you played together on the same machine.

Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Hacking: Open Contribution Thread
« Reply #65 on: May 21, 2012, 04:08:00 PM »

this is from memory, but i think the wood walls use a base-4 type scenario, and defined as N E S W

0 = no wall,
1 = plain wall
2 = open door
3 = closed door

so if we want  North = plain wall,   East South and West as nothing, we define that as; "1 0 0 0"

therefore  in binary;
01  00 00 00

and in hex $40

i will have to check my notes / editor code, but it's definately something like that!!
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

MadMunky

  • Forum Mod
  • A600
  • *****
  • Karma: 2
  • Offline Offline
  • Gender: Male
  • Posts: 244
Re: Hacking: Open Contribution Thread
« Reply #66 on: May 21, 2012, 04:29:29 PM »

That kind of makes sense 40,02 = West Facing Wall but there is loads which do not match the pattern i.e.

In the Keep - Level 4
Object Value: C402 X: 5 Y: 29
Object Value: 4702 X: 5 Y: 28
Object Value: 4002 X: 5 Y: 27
Object Value: 0102 X: 6 Y: 28
Object Value: 0D02 X: 8 Y: 28
« Last Edit: May 21, 2012, 04:38:43 PM by MadMunky »
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Hacking: Open Contribution Thread
« Reply #67 on: May 21, 2012, 04:40:35 PM »

i may have got the order wrong, in that it should be 'reversed'

bit   76   54  32  10
dir  WW  SS EE  NN


if NN (bit 0/1) =00  then there is nothing to the north.
if SS (bit 4/5) = 11 then there is a closed door south

this code would 'type out' the type of wall (it's from my editor)


Code: [Select]

_DESC2:

LINE$(10)="WOODEN STRUCTURE  "

EE=(AA*16)+BB

LINE$(11)="N: "
LINE$(12)="E: "
LINE$(13)="S: "
LINE$(14)="W: "

For COT=0 To 3
      BOT=COT*2

          If Btst(BOT,EE)=False and Btst(BOT+1,EE)=False : Rem  %%% NOTHING     
            LINE$(11+COT)=LINE$(11+COT)+"NOTHING     "

     Else If Btst(BOT,EE)=True and Btst(BOT+1,EE)=False : Rem  %%% WALL   
            LINE$(11+COT)=LINE$(11+COT)+"WOOD WALL   "

     Else If Btst(BOT,EE)=False and Btst(BOT+1,EE)=True : Rem  %%% OPEN DOOR     
            LINE$(11+COT)=LINE$(11+COT)+"OPEN DOOR   "

     Else If Btst(BOT,EE)=True and Btst(BOT+1,EE)=True : Rem  %%% CLOSED   
            LINE$(11+COT)=LINE$(11+COT)+"CLOSED DOOR "

      End If
Next COT


If Btst(0,CC)=True
   LINE$(15)="LOCKED"
Else
   LINE$(15)="NO LOCK"
End If

   For COT=10 To 15
      OPTION(COT)=True
   Next COT


Return

the two bytes of map-data are read-in as AA BB CC DD iirc. (again, maybe in reverse order)
 
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Hacking: Open Contribution Thread
« Reply #68 on: May 21, 2012, 04:42:44 PM »

Object Value: C402 X: 5 Y: 29

$c4 = 11 00 01 00
 north = nothing
 east = wall
 south = nothing
 west = closed door?

is this right? (i dont have the map here!)
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

MadMunky

  • Forum Mod
  • A600
  • *****
  • Karma: 2
  • Offline Offline
  • Gender: Male
  • Posts: 244
Re: Hacking: Open Contribution Thread
« Reply #69 on: May 21, 2012, 04:49:22 PM »

Sorry you where right :)

Cheers :)

Now Doors / Banners :)

Then Objects :s
« Last Edit: May 21, 2012, 07:25:02 PM by MadMunky »
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Hacking: Open Contribution Thread
« Reply #70 on: May 21, 2012, 07:58:57 PM »

if i had time to verify everything, i would use what i am posting here to update the general hacking information thread....  :/  sorry about that!

here is the similar code for metal doors, although i can see already bad working practices in it!! (oh how i have learnt so much since!)

Code: [Select]
_DESC5:
LINE$(10)="METAL DOOR       "
OPTION(11)=True
OPTION(12)=True
OPTION(13)=True
OPTION(14)=True



   If BB mod 4=0 or BB mod 4=1
       LINE$(11)="REGULAR        "
Else If BB mod 4=2 or BB mod 4=3
       LINE$(11)="PORTCULLIS     "
End If


     If BB mod 2=0
       LINE$(13)="OPEN          "
Else If BB mod 2=1
       LINE$(13)="CLOSED        "
End If


     If(BB=>0 and BB<=3) or(BB=>8 and BB<=11)
      LINE$(12)="NORTH / SOUTH  "
Else If(BB=>4 and BB<=7) or(BB=>12 and BB<=15)
      LINE$(12)="EAST / WEST    "
End If


     If CC mod 4=1
        LINE$(14)="LOCKED"
        LOCKED=1
        OPTION(15)=True

Else If AA=0
        LINE$(14)="UNLOCKED"
        LINE$(15)=""
        LOCKED=0
Else If AA>0 and(CC mod 4<>1)
        LINE$(14)="TRICK LOCK"
        OPTION(15)=True
End If


       If AA=0 and LOCKED=1 : LINE$(15)="MAGELOCKED"
   Else If AA=1 : LINE$(15)="BRONZE LOCK"
   Else If AA=2 : LINE$(15)="IRON LOCK"
   Else If AA=3 : LINE$(15)="SERPENT LOCK"
   Else If AA=4 : LINE$(15)="CHAOS LOCK"
   Else If AA=5 : LINE$(15)="DRAGON LOCK"
   Else If AA=6 : LINE$(15)="MOON LOCK"
   Else If AA=7 : LINE$(15)="CHROMATIC LOCK"
  Else If AA>=8 : LINE$(15)="INVALID LOCK"
   End If


If BB>=8
      LINE$(14)="LOCKED"
      LINE$(15)="VOID LOCK"
      OPTION(15)=True
End If

Return

i have now seen (been reminded!) that of the two bytes for each map-date piece, it's broken down as

AA BB CC DD

with DD as the 'type' (i.e. 0-7) and AA BB being the main parameters for each type.

with this, it seems that CC (like with many types) is used to define if the door is locked, and if there is any occupancy in that space (e.g. objects, people, spells)

For example, some of this works as follows;

for BB 
 
Bytes: % 3210

Byte 0 = open / close
Byte 1 =  regular metal / portcullis
byte 2 = north&south facing / east&west facing
byte 3 = black-locked

with AA this define what type of lock is used
if AA = 0 (and regular lock type from CC) , door is magelocked
AA=0 -> 7  = bronze, iron, serpent, chaos, dragon, moon, chromatic... all else invalid locks.


Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Hacking: Open Contribution Thread
« Reply #71 on: May 21, 2012, 08:01:06 PM »

for walls (banners etc) i am going to give you the code, but let you decipher for yourself!!

If you can please post a nice concise understanding of it here though,i will ultimately use it to update the main info thread as mentioned above :)

Code: [Select]
_DESC1:

   OPTION(11)=True



   LINE$(10)="STONE WALL"


If CC=>8 : Rem - has something on it

   OPTION(12)=True

      If CC=$8 or CC=$C : Rem - north
         LINE$(11)="FACING NORTH         "
 Else If CC=$9 or CC=$D : Rem - east
         LINE$(11)="FACING EAST          "
 Else If CC=$A or CC=$E : Rem - south
         LINE$(11)="FACING SOUTH         "
 Else If CC=$B or CC=$F : Rem - west
         LINE$(11)="FACING WEST          "
      End If


      If BB mod 4=0 : Rem Shelf
            LINE$(12)="SHELF         "

 Else If BB mod 4=1 : Rem Sign

Rem --- sign colours

         LINE$(12)="SIGN"
         OPTION(13)=True

       If AA=0 and BB=1 : Rem - seed sign
            LINE$(13)="GENERATED COLOUR"
  Else If AA=0 and BB=5 : Rem - serp sign
            LINE$(13)="SERPENT        "
  Else If AA=0 and BB=9 : Rem - dragon sign
            LINE$(13)="DRAGON       "
  Else If AA=0 and BB=13 : Rem - moon sign
            LINE$(13)="MOON          "
  Else If AA=1 and BB=1 : Rem - chaos sign
            LINE$(13)="CHAOS         "
  Else If BB mod 4=1 : Rem -- remainders are wall text
            LINE$(13)="SCROLL"+Str$((((AA*16)+BB)/4)-4)
   End If


 Else If BB mod 4=2 : Rem Switch

      OPTION(13)=True

         If(AA*16)+BB>=$7
             LINE$(12)="SWITCH"

                         If BB=$2 or BB=$A : Rem switch unused
                     LINE$(14)="LIT"
                   Else If BB=$6 or BB=$E : Rem switch used
                     LINE$(14)="DIM"
                    End If

                OPTION(14)=True

                EE=(AA*16)+BB
                SWITCH=(EE/8)-0
                LINE$(13)="REFERENCE:"+Str$(SWITCH)

   ' now lets talk about what the switch does

         SWITCHTYPE= Fn SWITCHTYPE
                  If SWITCHTYPE=0 : RESULT$="NO EFFECT"
             Else If SWITCHTYPE=2 : RESULT$="REMOVE"
             Else If SWITCHTYPE=4 : RESULT$="TOGGLE WALL"
             Else If SWITCHTYPE=6 : RESULT$="OPEN METAL DOOR"
             Else If SWITCHTYPE=8 : RESULT$="ROTATE WALL"
            Else If SWITCHTYPE=10 : RESULT$="TOGGLE PILLAR"
            Else If SWITCHTYPE=12 : RESULT$="PLACE PILLAR"
            Else If SWITCHTYPE=14 : RESULT$="ROTATE WOODEN"
                               Else RESULT$="INVALID"
             End If

         LINE$(16)=RESULT$
         LINE$(17)="X: "+Right$(Hex$( Fn SWITCHX+$100),2)+" Y: "+Right$(Hex$( Fn SWITCHY+$100),2)
            OPTION(16)=True
            OPTION(17)=True




      Else : LINE$(12)="SWITCH"
             LINE$(13)="EMPTY" : End If

 Else If BB mod 4=3 : Rem crystal hole

         LINE$(12)="SOCKET"
         OPTION(13)=True
         OPTION(14)=True

     EE=(AA*16)+BB

       If EE>=$0 and EE<=$7 : Rem -- serpent
            LINE$(13)="SERPENT"

  Else If EE>=$8 and EE<=$F : Rem -- chaos
            LINE$(13)="CHAOS"

  Else If EE>=$10 and EE<=$17 : Rem -- dragon
            LINE$(13)="DRAGON"

  Else If EE>=$18 and EE<=$1F : Rem -- moon 
            LINE$(13)="MOON"

  Else If EE>=$20 and EE<=$27 : Rem -- grey 
            LINE$(13)="GREY"

  Else If EE>=$28 and EE<=$2F : Rem -- bluish
            LINE$(13)="BLUISH"

  Else If EE>=$30 and EE<=$37 : Rem -- brown
            LINE$(13)="BROWN"

  Else If EE>=$38 and EE<=$3F : Rem -- tan
            LINE$(13)="TAN"

  Else If EE>=$40 and EE<=$FF : Rem -- everything else that isnt
            LINE$(13)="INVALID"

   End If

      If BB=$3 or BB=$B : Rem --- if full
            LINE$(14)="FULL"

 Else If BB=$7 or BB=$F : Rem -- if empty

            LINE$(14)="EMPTY"
  End If

  End If


Else
         LINE$(11)="PLAIN"

End If

Return

p.s. hope all this helps - and have fun :)
« Last Edit: May 21, 2012, 08:06:32 PM by Hungry Horace »
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

MadMunky

  • Forum Mod
  • A600
  • *****
  • Karma: 2
  • Offline Offline
  • Gender: Male
  • Posts: 244
Re: Hacking: Open Contribution Thread
« Reply #72 on: May 21, 2012, 09:50:36 PM »

Cheers Horace :)

Didnt ever know if you where still around on the forums as you have been quiet for some time.

Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Hacking: Open Contribution Thread
« Reply #73 on: May 21, 2012, 09:57:19 PM »

Cheers Horace :)

Didnt ever know if you where still around on the forums as you have been quiet for some time.

No problem!


I have a lot going on in the "real world" atm that is preventing me from being involved in anything new, but i will always check this forum and chip-in where i can :)




edit:

thanks to my earlier post, i updated the wooden walls data definition:

http://www.ultimateamiga.co.uk/index.php/topic,8908.msg39946.html#msg39946
« Last Edit: May 21, 2012, 10:33:31 PM by Hungry Horace »
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

MadMunky

  • Forum Mod
  • A600
  • *****
  • Karma: 2
  • Offline Offline
  • Gender: Male
  • Posts: 244
Re: Hacking: Open Contribution Thread
« Reply #74 on: May 23, 2012, 07:11:18 PM »

Wood Walls and Banners/Switches now supported just need Gem Slots and to sort out the Doors now..



Logged
Pages: 1 ... 3 4 [5] 6 7 ... 11   Go Up
 

TinyPortal 2.2.2 © 2005-2022