Heaven/TQA Posted December 29, 2006 Author Share Posted December 29, 2006 ok. the new v10 of the prototype generates correct dungeons... here is the code of the dungeon/room generator + screenshot of the output... the interesting thing is that compared to the turbo basic version the assembler routine generates <1 sec a whole floor map... so stay tuned...maybe on weekend you will be able to walk around when the code is fully implemented in the beyond evil engine... ;mapping routine ; roomxtab equ $a000;holds track of max. 64 room positions ; roomytab equ $a040 ; roomxxtab equ $a080;holds track of max. 64 room sizes ; roomyytab equ $a0c0 ; max_rooms equ $40 ;maximum 64 rooms sxtab dta 5,10,15,20,5,10,7,10 sytab dta 5,10,7,10,20,10,15,20 room_no dta 0 room_xp dta 0 room_yp dta 0 room_sx dta 0 room_sy dta 0 room_sx2 dta 0 room_sy2 dta 0 room_oldx dta 0 room_oldy dta 0 room_oldsx dta 0 room_oldsy dta 0 room_oldsx2 dta 0 room_oldsy2 dta 0 iterations dta 0 level_map_no dta 0 gen_map ldx #0 stx room_no ;generate start-room in middle of the map lda #127 sta room_xp lda #95 sta room_yp jsr _get_random and #7 tay lda sxtab,y sta room_sx sta roomxxtab,x lda sytab,y sta room_sy sta roomyytab,x lda room_xp sta roomxtab,x sta room_oldx lda room_yp sta roomytab,x sta room_oldy inx;room+1 ;do gen_loop lda #0 sta iterations gen_next00 jsr _get_random and #7 tay lda sxtab,y sta room_sx lda sytab,y sta room_sy lda room_sx lsr sta room_sx2 lda room_oldsx lsr sta room_oldsx2 lda room_sy lsr sta room_sy2 lda room_oldsy lsr sta room_oldsy2 gen_next0 jsr _get_random and #3 bne gen_next1 ;0? sec lda room_oldx sbc room_sx2 clc adc room_oldsx2 sta room_xp sec lda room_oldy sbc room_sy sta room_yp jmp gen_exit gen_next1 cmp #1 bne gen_next2 sec lda room_oldx sbc room_sx2 clc adc room_oldsx2 sta room_xp clc lda room_oldy adc room_oldsy sta room_yp jmp gen_exit gen_next2 cmp #2 bne gen_next3 clc lda room_oldx adc room_oldsx sta room_xp sec lda room_oldy sbc room_sy2 clc adc room_oldsy2 sta room_yp jmp gen_exit gen_next3 sec lda room_oldx sbc room_sx sta room_xp sec lda room_oldy sbc room_sy2 clc adc room_oldsy2 sta room_yp gen_exit inc iterations jsr test_room lda roomflag ;if flag=-1 and iterations<10 then try new direction bpl gen_exit4 lda iterations cmp #10 bcs gen_exit3 jmp gen_next0 gen_exit3 cmp #50 bcs gen_exit30 jmp gen_next00 gen_exit30 rts gen_exit4 lda room_xp sta room_oldx sta roomxtab,x lda room_yp sta room_oldy sta roomytab,x lda room_sx sta room_oldsx sta roomxxtab,x lda room_sy sta room_oldsy sta roomyytab,x inc room_no inx ;next room cpx #max_rooms bcs gen_exit2 jmp gen_loop gen_exit2 rts ;checks if the new room is overlapping an old one c dta 0 roomflag dta 0 test_room ldy #0 sty c sty roomflag test_room_loop clc lda room_xp adc room_sx cmp roomxtab,y bcc test_exit clc lda roomxtab,y adc roomxxtab,y cmp room_xp bcc test_exit clc lda room_yp adc room_sy cmp roomytab,y bcc test_exit clc lda roomytab,y adc roomyytab,y cmp room_yp bcc test_exit jmp test_exit00 test_exit iny cpy room_no bcc test_room_loop test_exit00 cpy room_no bcs test_exit2 lda #-1 sta roomflag ;endend jmp endend test_exit2 rts Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 2, 2007 Author Share Posted January 2, 2007 small update... a simple draw room routine implemented... each level up the next following room is printed on screen. next step will be the long awaited collision detection and the "walk around the map"-routine. but i have to think about how the map generator inserts correct doors in the walls and how internally they are saved so the move routine knows into which rooms the player can walk on and back.... diablo10.zip Quote Link to comment Share on other sites More sharing options...
Cybernoid Posted January 3, 2007 Share Posted January 3, 2007 Great work. This is beyond good... ahem... evil. So, are you still thinking of an isometric game as well? Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 3, 2007 Author Share Posted January 3, 2007 thanks. not sure if Beyond Evil - part one will feature iso... maybe part 2... but we will see. PGs great gfx set for iso is not so easy to draw via assembler... as it has many "special cases" when drawing to make it looking good. but maybe i have to try as on a first look my new room generator was impossible as well and then it was done in 1 hour in assembler... Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 4, 2007 Author Share Posted January 4, 2007 small update: - grass removed as we are are indoor - made it darker - player can only move inside a room - monsters are spawn into rooms - internally the "room path" to the end is saved but not checked at the moment as the rooms have no exit anyway. but internally a complete level is generated with max. 64 rooms and their connections... to do's for next update: - player could travel out of each room each time when reaching a door - correct drawing of the room with top, edges, loot etc... - correct position of the room. right now it is set into the top middle of the screen. but it should be like when you are walking to the right, the screen is cleared and the next room is put on the left side of the screen. so always on the opposite screenhalf. - doors should be put into the rooms - for each room monsters should be set from the mapp generator... then it could be interesting to test multiple monsters attacking... the monster engine is prepared but not enabled yet... diablo10.zip Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 5, 2007 Author Share Posted January 5, 2007 oh... interesting... why does the game crash when the room is a 10x10 room???? Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 5, 2007 Author Share Posted January 5, 2007 (edited) it took unbelievable 4 hours to implement doors... (the drawing... not the "walk through"-routine) and some couple of beers... can you please have a look and play it? after each monster kill you "automaticly" walk through the next door... each room (except the first oneÄ) should have 2 doors, one where you entered and one where you leave... after each kill you are moving "forward" to the next room... can you please test and "imagine" the walk if the doors are correct???? i am not 100% sure yet... so my door-setting routine could be wrong... for the real maniacs... you'll find the direction table at $a100-$a13f... for each of the room the door directions are marked. $xy x - points to the last room, so where do you came from y - points to the next room, so where you can walk $0x = north = $x0 $1x = south = $x1 $3x = west = $x3 $2x = east = $x2 $a140-$a17f hold the direction where the next room is located... so $a100 table is a mixture of both... but it seems that there is a bug... have to double check later... now i am tired... ps. seems i have fixed another bug with the doors... diablo10.zip Edited January 6, 2007 by Heaven/TQA Quote Link to comment Share on other sites More sharing options...
Ghost... Posted January 6, 2007 Share Posted January 6, 2007 Hi, can you please test and "imagine" the walk if the doors are correct???? i am not 100% sure yet... so my door-setting routine could be wrong... I think there is a problem with the part of the routine for the north/south doors. Sometimes there is no door at all. Try a first room with the door to the south. In the most cases the next room will be wrong (only doors to the east and west). Maybe that gives you an idea what problem could be... best! -/\/\artin Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 6, 2007 Author Share Posted January 6, 2007 fixed... now the doors should be ok... i was just wondering why there are no items dropped... but hey... i am painting each kill after the drop the new room over the screen...so that's why all items disappear... diablo10.zip Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 6, 2007 Author Share Posted January 6, 2007 (edited) ok.ok... still little buggy and not perfekt but now you can walk between the rooms!!! check this new one... now you items etc work again... ps. player/monsters are not repositioned yet after entering new room, like f.e. next to the door etc... but good progress so far... just let me know what you think... diablo10.zip Edited January 6, 2007 by Heaven/TQA Quote Link to comment Share on other sites More sharing options...
miker Posted January 6, 2007 Share Posted January 6, 2007 (edited) Ok, here's one bug in the attachment. The gold has appeared on the wall and the player cannot pick it up (figure #1). A suggestion - how about limited amount of creatures per each room and some kind of remembering the amount of them in these rooms (to avoid multiple killing when you return to the same room after a while) and other set of them in each room... Also placing the hero on opposite side of the room would be handy. One more bug - the enemy after changing room by hero sometimes leaves a "hole" in the wall (figure #2). There's also gold which has "leaked" through it. When the hole appears on the door, it's impossible to leave room through it. And sometimes the dungeon disappears and the player can move only in Y-axis (really sometimes but it still happens), then disappears after defeating the enemy (figure #3) Last one: still the armor bug occurs. Edited January 6, 2007 by miker Quote Link to comment Share on other sites More sharing options...
Cybernoid Posted January 6, 2007 Share Posted January 6, 2007 Oh... this is very cool!!! and fun!!! Hehehe... like the graphics! Powrooz would be happy... Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 6, 2007 Author Share Posted January 6, 2007 miker... thanks for the buglist... my comments: - wholes in the wall + chars placed on the wall. will be fixed in next release. that is what i ment with "no repositioning yet". the dropping + enemies are not "room based" yet. - mapper still has not the functionality which i have in mind. so i want to "pregenerate" for each floor (=complete level map with max. 64 rooms) what kind of monster will appear and how many. so f.e. if one room contains monsters with level 1-3 and 3 of them. atfer you have killed all of them no new will spawn even if you come back. - first room/last room are not yet treated. so when you are entering the last room of the map or in some cases the first room the mentioned "one door at the top" + only y-movement possible appears. that is simply because not implemented yet any code... - armor bug... the damned armor bug... can not find it yet... Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 6, 2007 Author Share Posted January 6, 2007 last update for tonight... - you can walk through the doors and you will be positioned correctly to the door - when entered new room monster is new - room indicator in the status line. now you can see the room you are in (for debugging or do you need that information in real?) - you CAN NOT walk back into room 0... if so this will cause unpredictable effects like the one miker described maybe by tomorrow i will improve something completly different... f.e. that you can DROP weapons... from your inventory... over and out... diablo10.zip Quote Link to comment Share on other sites More sharing options...
miker Posted January 7, 2007 Share Posted January 7, 2007 (edited) Hmm... sometimes it's still possible to reach room "0" again - with the result described in my earlier post. Sometimes it happens when you try to leave room during fight. Is there any way to use potions? For now i almost alway end on 4-5 level running out of energy. And how about making the inventory more diablo'ish (somehow as in attached pic). I know it will require additional graphics. But maybe it's good idea to add it later. Edited January 7, 2007 by miker Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 7, 2007 Author Share Posted January 7, 2007 miker? you can use potions by pressing space? Quote Link to comment Share on other sites More sharing options...
miker Posted January 7, 2007 Share Posted January 7, 2007 oh, haven't tried :] Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 7, 2007 Author Share Posted January 7, 2007 re: inventory each item has 2 additional status bytes left which are not used right now. they could be used for a kind of inventory system (weight f.e.). i looked at the beginning on the playstation 1 version of diablo because of controls and the inventory... but right now it is too complicated for me to invent or code a system like that i am afraid... the inventory itself will be expanded little bit as it still collects only weapons and not yet armor/shild/helmets/scrolls... so when these types are there as well... i have to think about how we will manage the stuff inkl. wearing. Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 7, 2007 Author Share Posted January 7, 2007 here again the controls for everybody: - joystick to move the player - fire to attack monster when you are over and near a monster - pick up items by walking over them. they are put automaticly into inventory. potions are collected separatly - heal potions can be drunk by pressing SPACE on the keyboard - hit I to enter the inventory. here you find all collected weapons. press the desired key to equipt the weapon. the weapon stats can be checked in the character screen. but as longer the name of a weapon is as better the weapon... f.e. magical - hit C to enter the character screen. here you will find all character relevant information like your attributes. you can check your weapons as well how they affect your attributes...some improve your strength, some make you weaker but faster etc... more than 12000 different weapons can be found in the game - exit all sub-screens by pressing ESCape - when you collected enough experience your character can be "leveled up". so you can improve your char by spending 5 points... with joystick left/right you can move the marker in the main screen to which stat you want to alter (arrow up). by pressing fire you can spend one point. f.e. improving STRength will make more damage or by improving DEX makes you faster and its more likely that you hit your enemy as you get more experienced with weapons. enpowering VITality will increase your overall health. there are more secret stats which can be affected by magical weapons or armors. - after game over (flashing screen) you can press START to reenter the game.... but i havent tested it yet but its esp. for miker. - the room layout or dungeon floor is random and each game you play completly different... so no need to draw maps on piece of paper... - the monsters are getting harder as you progress. - after you kill a monster it's likely that they drop gold, potions, weapons or nothing... anything else you want to know? Quote Link to comment Share on other sites More sharing options...
miker Posted January 7, 2007 Share Posted January 7, 2007 (edited) The "0" room bug can be elliminated by creating "one-way" doors from room "0" to the next one or just by ommiting the door in second room. Now the hero leaves "itself" near the door, appears on the opposite side of room and now every door points to "no-walled" room "0" Ok, played a little more and reached level 10 (thanx for the potion-tip!). The creatures look strange - just as some parts of walls, and when you try to fight them, they dissappear after a while and the hero does it as well... Also, sometimes after playing a while, the inventory/character specs screen becomes corrupted a littlle. Does the STRrength really affect the damage? - haven't see any results. DEX & VIT seem to be working OK. And here's the new "enemy" on level 10: Edited January 7, 2007 by miker Quote Link to comment Share on other sites More sharing options...
miker Posted January 7, 2007 Share Posted January 7, 2007 (edited) It seems that the game becomes corrupted/unplayable after a while... The "new characters" appear even after restarting, then either creature and hero disappear from the screen. Sometimes when you try to get out room "0", the other "no-walled" room appears with nothing there inside, too... Edited January 7, 2007 by miker Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 7, 2007 Author Share Posted January 7, 2007 (edited) thanks miker. i will look into it... what you (and others of course...) can do is make a memory snapshot in the emulator and send me the file so i can have a look into it... following comes to mind regarding what you have discovered: - max. item in inventory = 16 but there is no internal check yet - max player level 10. the monster table is having 10 entries but there is no internal check as well when they are exceeded. so non-monster data is read by the monster engine seems i should implement them now... Thanks, Miker. ps. 22 potions collected? seem that they drop too often so i should reduce their droprate... ??? Edited January 7, 2007 by Heaven/TQA Quote Link to comment Share on other sites More sharing options...
miker Posted January 7, 2007 Share Posted January 7, 2007 Well, in the next challenge i haven't found any potion, so maybe let it be as is now. Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 11, 2007 Author Share Posted January 11, 2007 simply for your pleassure i spend 5 minutes to expand the max. player level to 17... check it out... (so no bugs resovled just expaned the tables) diablo10.zip Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 13, 2007 Author Share Posted January 13, 2007 (edited) small update version 10b... - bug should be fixed to get beyond level 10 - each level you can spend only 3 points instead of 5. you can spend max. 3 points. if you want to spend less simply hit ESC - when you are reaching new level you get healed before entering the "improve stats" loop. its now more diablo like - DEX is not improving too fast even when spend points on it - gfx glitches in one font fixed. now there should be no colour problems - items are dropped on last monster positition so its more unlikely that they are dropped on walls or outside the room - autopick up is TURNED OFF. so now you can decide if you want to pick up or not. just hold fire when you are over an item more to come this weekend... i realised that with a heavy plate armor + broad axe (even not magical) you are nearly unbeatable... so it seems the stats need to be altered... just let me know what you are feel and give me your suggestions. everything is welcome. ps. there is a new bug in the inventory code... you can use it as a cheat... when your health is low. switch to inventory and quit by hitting esc. now your health is full. diablo10.zip Edited January 13, 2007 by Heaven/TQA Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.