Topic:   Tides of Fáden (out of production)   (Read 57342 times)


0 Members and 1 Guest are viewing this topic.

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Tides of Fáden (in production)
« Reply #90 on: December 17, 2008, 12:02:22 PM »
209!? that seems a bit high for just and enemy moving around don't you think you could chop that down a bit cause it wouldn't be that hard to make it so that when you attack him he attacks back and he chases you to attack you doesn't seem like it should take that many lines of code.  

P.S. Kinda reminds me of NAFTA 2000 page long contract but seems to me they could write you don't tax me I don't tax you on a whole lot less pages.
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Tides of Fáden (in production)
« Reply #91 on: December 17, 2008, 02:42:15 PM »
It's 209 after I did the clean up. It was considerably more. The entire battle engine is in the routine you see.
I survived the spammage of 2007

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: Tides of Fáden (in production)
« Reply #92 on: December 17, 2008, 03:09:01 PM »
yea sinse gm doesnt have methods. maybe we all can collaborate and cut it down, could you post the 209loc?
« Last Edit: December 17, 2008, 03:09:27 PM by EqwanoX »

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Tides of Fáden (in production)
« Reply #93 on: December 17, 2008, 05:32:14 PM »
You're very kind to offer. Personally I'm quite pleased with 209 and wouldn't bother trying to compress it any further, (the player's is 6 lines short of 400) but if you'd like to see the code you're most welcome to it:

Code: [Select]
ON TIMER -50
IF locktimer = 0 THEN
 Â P1hitNPC = 0
 Â P2hitNPC = 0
 Â IF NPCalive > 0 THEN
'---NPC CODE------------------------------------------------------------------------------------
 Â   NPCnewtile$ = "empty"
'----NPC AI--------------------------------------------------------------------------------------
 Â   NPCaction = RANDOM 4
 Â   IF NPCaction = 1 THEN NPCaction$ = "moveup"
 Â   IF NPCaction = 2 THEN NPCaction$ = "movedown"
 Â   IF NPCaction = 3 THEN NPCaction$ = "moveleft"
 Â   IF NPCaction = 4 THEN NPCaction$ = "moveright"
'    IF NPCaction = 5 THEN NPCaction$ = "stay"
 Â   IF NPCaction$ = "moveup" THEN NPCmoveY = NPCgridY - 1
 Â   IF NPCaction$ = "movedown" THEN NPCmoveY = NPCgridY + 1
 Â   IF NPCaction$ = "moveleft" THEN NPCmoveX = NPCgridX - 1
 Â   IF NPCaction$ = "moveright" THEN NPCmoveX = NPCgridX + 1
'---/NPC AI--------------------------------------------------------------------------------------
'---NPC GRID CODE--------------------------------------------------------------------------------
 Â   NPCmoveXY = 0
 Â   NPCmoveXY = 7 * NPCmoveY
 Â   NPCmoveXY = NPCmoveXY - 7
 Â   NPCmoveXY = NPCmoveXY + NPCmoveX
 Â   NPCnewtile$ = MID$ gridlayout$ NPCmoveXY 1
 Â   IF NPCnewtile$ = "0" THEN
 Â     NPCnewtile$ = "empty"
 Â   ELSE
 Â     NPCnewtile$ = "wall"
 Â   END IF
 Â   IF NPCmoveY = 0 THEN NPCnewtile$ = "wall"
 Â   IF NPCmoveY = 8 THEN NPCnewtile$ = "wall"
 Â   IF NPCmoveX = 0 THEN NPCnewtile$ = "wall"
 Â   IF NPCmoveX = 8 THEN NPCnewtile$ = "wall"
'---/NPC GRID CODE------------------------------------------------------------------------------
'----MOVE NPC SPRITE----------------------------------------------------------------------------
 Â   IF NPCnewtile$ = "empty" THEN
 Â     IF NPCaction$ = "moveup" THEN NPCspriteY = NPCspriteY - 44
 Â     IF NPCaction$ = "movedown" THEN NPCspriteY = NPCspriteY + 44
 Â     IF NPCaction$ = "moveleft" THEN NPCspriteX = NPCspriteX - 44
 Â     IF NPCaction$ = "moveright" THEN NPCspriteX = NPCspriteX + 44
 Â     NPCgridY = NPCmoveY
 Â     NPCgridX = NPCmoveX
 Â   ELSE
 Â     NPCmoveY = NPCgridY
 Â     NPCmoveX = NPCgridX
 Â   END IF
 Â   SPRITE 13 NPCspriteX NPCspriteY
 Â END IF
'---/MOVE NPC SPRITE----------------------------------------------------------------------------
'----NPC SPAWN---------------------------------------------------------------------------------
 Â IF NPCalive = 0 THEN
 Â   NPCspawnchance = RANDOM 7
 Â   IF NPCspawnchance = 1 THEN
 Â     NPCtype = RANDOM 1 1 1 1 2 2 2 3 3
 Â     IF NPCtype = 1 THEN
 Â       NPCsprite$ = NPCsprite1$
 Â       enemyname$ = enemyname1$
 Â       enemyLVL = enemyLVL1
 Â       enemymaxHP = enemymaxHP1
 Â       enemyHP = enemymaxHP
 Â       enemyATK = enemyATK1
 Â       enemyDEF = enemyDEF1
 Â       enemygold = enemygold1
 Â     END IF
 Â     IF NPCtype = 2 THEN
 Â       NPCsprite$ = NPCsprite2$
 Â       enemyname$ = enemyname2$
 Â       enemyLVL = enemyLVL2
 Â       enemymaxHP = enemymaxHP2
 Â       enemyHP = enemymaxHP
 Â       enemyATK = enemyATK2
 Â       enemyDEF = enemyDEF2
 Â       enemygold = enemygold2
 Â     END IF
 Â     IF NPCtype = 3 THEN
 Â       NPCsprite$ = NPCsprite3$
 Â       enemyname$ = enemyname3$
 Â       enemyLVL = enemyLVL3
 Â       enemymaxHP = enemymaxHP3
 Â       enemyHP = enemymaxHP
 Â       enemyATK = enemyATK3
 Â       enemyDEF = enemyDEF3
 Â       enemygold = enemygold3
 Â     END IF
 Â     enemyEXPvalue = 100 * enemyLVL
 Â     NPCspawnlocation = RANDOM 3
 Â     IF NPCspawnlocation = 1 THEN NPCgridX = NPCgridX1
 Â     IF NPCspawnlocation = 1 THEN NPCgridY = NPCgridY1
 Â     IF NPCspawnlocation = 2 THEN NPCgridX = NPCgridX2
 Â     IF NPCspawnlocation = 2 THEN NPCgridY = NPCgridY2
 Â     IF NPCspawnlocation = 3 THEN NPCgridX = NPCgridX3
 Â     IF NPCspawnlocation = 3 THEN NPCgridY = NPCgridY3
 Â     NPCspriteY = NPCgridY * 44
 Â     NPCspriteY = NPCspriteY - 39
 Â     NPCspriteX = NPCgridX * 44
 Â     NPCspriteX = NPCspriteX - 39
 Â     NPCmoveY = NPCgridY
 Â     NPCmoveX = NPCgridX
 Â     SHOWBUTTON 3 $enemyname$$ $enemyHP$
 Â     SPRITE 13 NPCspriteX NPCspriteY $NPCsprite$$
 Â     NPCalive = 1
 Â   END IF
 Â END IF
'---/NPC SPAWN---------------------------------------------------------------------------------
 Â NPCcollide = SPRITECOLLIDE 15 13
 Â IF NPCcollide = 1 THEN P1hitNPC = 1
 Â NPCcollide = SPRITECOLLIDE 14 13
 Â IF NPCcollide = 1 THEN P2hitNPC = 1
'---/NPC CODE-----------------------------------------------------------------------------------
« Last Edit: December 17, 2008, 05:34:29 PM by Silverwind »
I survived the spammage of 2007

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Tides of Fáden (in production)
« Reply #94 on: December 17, 2008, 05:33:25 PM »
Continuation:

Code: [Select]
'----BATTLE-------------------------------------------------------------------------------------
  IF P1hitNPC > 0 THEN
    SOUND Attack
    reprintHP = 1
    damage = RANDOM baseweapondamage
    damage = damage + P1ATK
    damage = damage - enemyDEF
    IF damage < 0 THEN damage = 0
    enemyHP = enemyHP - damage
    damage = RANDOM baseweapondamage
    damage = damage + enemyATK
    damage = damage - P1DEF
    IF damage < 0 THEN damage = 0
    P1HP = P1HP - damage
  END IF
  IF P2hitNPC > 0 THEN
    SOUND Attack
    reprintHP = 1
    damage = RANDOM baseweapondamage
    damage = damage + P2ATK
    damage = damage - enemyDEF
    IF damage < 0 THEN damage = 0
    enemyHP = enemyHP - damage
    reprint = 1
    damage = RANDOM baseweapondamage
    damage = damage + enemyATK
    damage = damage - P2DEF
    IF damage < 0 THEN damage = 0
    P2HP = P2HP - damage
  END IF

  IF reprintHP = 1 THEN
    reprintHP = 0
    IF P1alive > 0 THEN
      SHOWBUTTON 1 $P1name$$ $P1HP$
      IF P1HP < 1 THEN P1alive = -1
      IF P1HP < 1 THEN SPRITE -15
      IF P1HP < 1 THEN pet1alive = 0
      IF P1HP < 1 THEN SPRITE -12
      IF P1HP < 1 THEN HIDEBUTTON 1
      IF P1HP < 1 THEN SOUND Player Dying
      IF P1HP < 1 THEN CLEAR TEXT
      IF P1HP < 1 THEN PRINT $P1name$$ has been defeated!
    END IF
    IF P2alive > 0 THEN
      SHOWBUTTON 2 $P2name$$ $P2HP$
      IF P2HP < 1 THEN P2alive = -1
      IF P2HP < 1 THEN SPRITE -14
      IF P2HP < 1 THEN pet2alive = 0
      IF P2HP < 1 THEN SPRITE -11
      IF P2HP < 1 THEN HIDEBUTTON 2
      IF P2HP < 1 THEN SOUND Player Dying
      IF P2HP < 1 THEN CLEAR TEXT
      IF P2HP < 1 THEN PRINT $P2name$$ has been defeated!
    END IF
    IF NPCalive > 0 THEN
      SHOWBUTTON 3 $enemyname$$ $enemyHP$
      IF enemyHP < 1 THEN
        NPCalive = 0
        SPRITE -13 1000 1000
        HIDEBUTTON 3
        SOUND Enemy Dying
        enemyEXPvalue = 100 * enemyLVL
        IF P1hitNPC = 1 THEN
          enemyEXPminus = 50 * P1LVL
          enemyEXPvalue = enemyEXPvalue - enemyEXPminus
          P1EXP = P1EXP - enemyEXPvalue
          IF P1EXP < 0 THEN P1EXP = 0
          P1gold = P1gold + enemygold
          IF P1gold > maxgold THEN P1gold = maxgold
          CLEAR TEXT
          PRINT $P1name$$ slays the $enemyname$$!
          PRINT + $enemyEXPvalue$ EXP
          IF enemygold > 1 THEN PRINT + $enemygold$ gold
        END IF
        IF P2hitNPC = 1 THEN
          enemyEXPminus = 50 * P2LVL
          enemyEXPvalue = enemyEXPvalue - enemyEXPminus
          P2EXP = P2EXP - enemyEXPvalue
          IF P2EXP < 0 THEN P2EXP = 0
          P2gold = P2gold + enemygold
          IF P2gold > maxgold THEN P2gold = maxgold
          CLEAR TEXT
          PRINT $P2name$$ slays the $enemyname$$!
          PRINT + $enemyEXPvalue$ EXP
          IF enemygold > 1 THEN PRINT + $enemygold$ gold
        END IF
      END IF
    END IF
    IF P1alive < 1 THEN
      IF P2alive < 1 THEN
        ALERT You've been defeated! You surrender your gold and equipment and retreat to the nearest inn...
        GOTOCARD 244
      END IF
    END IF
  END IF
'---/BATTLE-------------------------------------------------------------------------------------
END IF
END TIMER
I survived the spammage of 2007

GuthanSoftware


  • GMG-er

  • **


  • Posts: 105

  • GuthanSoftware
Re: Tides of Fáden (in production)
« Reply #95 on: December 18, 2008, 03:59:07 PM »
Wow Silver this is impressive. Btw thanks for screen recorder for this. I can finally record on a mac!
Stupid Test Creator
Sim School Creator
Windox Creator
and more

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Tides of Fáden (in production)
« Reply #96 on: December 18, 2008, 04:28:30 PM »
Glad you like it. :)
I survived the spammage of 2007

GuthanSoftware


  • GMG-er

  • **


  • Posts: 105

  • GuthanSoftware
Re: Tides of Fáden (in production)
« Reply #97 on: December 18, 2008, 05:44:10 PM »
Yep =)
Stupid Test Creator
Sim School Creator
Windox Creator
and more

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Tides of Fáden (in production)
« Reply #98 on: December 28, 2008, 03:42:13 PM »
I'm calling a halt to development until I work out how to program a few new things. I don't wanna spend hours of precious time working with an engine that I'm quite likely to get bored with, thus making progress a chore. Instead I'm gonna think hard on how to implement some of the cool features and upgrades I want over QoM's engine and resume content design once the engine's complete.

Unfortunately I guess this will result in a progress drought, but hopefully a much nicer finished product too. Among the things I wanna improve are the Inventory, Navigation and RT Combat System.
« Last Edit: December 28, 2008, 03:43:55 PM by Silverwind »
I survived the spammage of 2007

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Tides of Fáden (in production)
« Reply #99 on: December 29, 2008, 01:09:01 PM »
Wonderfully bone chilling news from the desk of Roguesoft! I've just invented a new method to spice up dungeon exploration. Each time you enter a dungeon the computer generates a fixed amount of monsters and treasure chests and places them in random locations. So after you've slayn the monsters they won't respawn until the next time you enter the dungeon. Treasure chests work exactly the same way, and they'll contain items chosen randomly by the computer from a dungeon specific "Loot List" meaning you might have to explore a dungeon several times in order to get a specific item.

The reason why I like this system is because it saves me time designating spawn spots on each card (seeing as how I'll only have to write the routine once) as well as maintaining randomness in previously explored dungeons, thus providing more replay value.

EDIT:

Another plus is that players will no longer be able to cower back to the Cleric after each battle, as doing so will reset their exploration progress. ;D
« Last Edit: December 29, 2008, 01:13:50 PM by Silverwind »
I survived the spammage of 2007

WarHampster


  • GMG Extraordinaire

  • ***


  • Posts: 1501

  • The People's Moderator
    • Arcade of the Absurd
Re: Tides of Fáden (in production)
« Reply #100 on: December 31, 2008, 07:14:04 PM »
Nice, but make sure to make health potions more readily available.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Tides of Fáden (in production)
« Reply #101 on: January 03, 2009, 03:46:34 PM »
Definitely. ;)

I've actually changed my mind about most of the above however, but the point about the potions is still valid. Turns out it was more work when I came to actually program it. Bah, instead I'll just have enemies spawn on a completely random space rather than a space chosen from a pre-written list. It'll save me loads of time designating spawn spots, but the downside is that they might spawn in unlikely locations. (such as between a box of trees) Still though, adds unknowingness to the game. (should so be a word. I know random would suffice, but it's overused)
I survived the spammage of 2007

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Tides of Fáden (in production)
« Reply #102 on: January 03, 2009, 05:21:12 PM »
Progress Update:

I've got Eq's "No walking on top of enemy sprites" thing working now as well as the random NPC spawn location thingy. Here's the code for anyone who wants to use it:

Locate an unoccupied space on the map. (ie: not a mountain, tree or water tile)
Code: [Select]
      NPCspawnlocation = RANDOM 49
 Â     NPCspawntile$ = MID$ gridlayout$ NPCspawnlocation 1
 Â     REPEAT
 Â       IF NPCspawntile$ <> "0" THEN
 Â         NPCspawnlocation = NPCspawnlocation + 1
 Â         NPCspawntile$ = MID$ gridlayout$ NPCspawnlocation 1
 Â       END IF
 Â       IF NPCspawntile$ = "0" THEN EXIT REPEAT
 Â     END REPEAT

After locating an appropriate spawn spot, determine what the NPC's grid coordinates are.
Code: [Select]
      XYcalculator = 0
 Â     NPCgridX = 0
 Â     NPCgridY = 1
 Â     REPEAT
'     This line is to prevent the "repeat glitch" where the first line in a repeat block isn't executed.
 Â       XYcalculator = XYcalculator + 1
 Â       NPCgridX = NPCgridX + 1
 Â       IF NPCgridX = 8 THEN NPCgridY = NPCgridY + 1
 Â       IF NPCgridX = 8 THEN NPCgridX = 1
 Â       IF XYcalculator = NPCspawnlocation THEN EXIT REPEAT
 Â     END REPEAT

Determine what the NPC's sprite coordinates are based off the grid coordinates.
Code: [Select]
      NPCspriteY = NPCgridY * 44
 Â     NPCspriteY = NPCspriteY - 39
 Â     NPCspriteX = NPCgridX * 44
 Â     NPCspriteX = NPCspriteX - 39
 Â     NPCmoveY = NPCgridY
 Â     NPCmoveX = NPCgridX

EDIT:

I've separated the routine to make it easier to understand. Quite nice to look at I think. :)

*sigh* ANOTHER EDIT:

Crap, I've just realized that this isn't a true randomizer, as the odds for where NPC's spawn are heavily influenced by the amount of non traversable tiles on the grid. Oh well, it'll have to do until I work out how to code a true randomizer using arrays.

You know the drill by now:

I've just figured it out. It's easy. It'll have to wait 'til tomorrow though as I'm up early for bowling practice, but rest assured that we shall be gaping in awe at a true random NPC positioner come tomorrow.
« Last Edit: January 04, 2009, 05:12:19 PM by Silverwind »
I survived the spammage of 2007

Gnome


  • GMG Extraordinaire

  • ***


  • Posts: 1073
Re: Tides of Fáden (in production)
« Reply #103 on: January 03, 2009, 05:37:10 PM »
Whats the "<>" do in the first part?
This Cannot be, NOOOOOOOO!!!!

-Gnomes Cry when the McRib was discontinued again.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Tides of Fáden (in production)
« Reply #104 on: January 03, 2009, 05:39:49 PM »
It's the equivalent of "if var equals anything except the following value" :)

btw, I've edited the above post again with joyous news.
I survived the spammage of 2007