Jump to content

jrok's Photo

jrok

Member Since 27 Aug 2008
OFFLINE Last Active Oct 26 2011 4:07 PM

Topics I've Started

questions about the stack command

Tue Aug 23, 2011 11:24 AM

This is sort of a two part question. I was curious whether or not it would be possible to create a variable stack pointer? In other words, something like:

  dim myVar = a

  x = 187

  stack 188 : push myVar  
  (...)
  stack x : pull myVar

I know that the above statement won't work (I mean, it will compile, but it won't retrieve the value at 187), but I was curious if there was a method that would do something similar?

The second part of my question is that, if a variable pointer can be used, can we then write a function that points to a location on the stack, and then pulls/pushes a block of contiguous stack data (perhaps with a for-next loop)?

Would it help to give a specific example of what I'm trying to do?

Untitled Dungeon Crawler

Sun Aug 21, 2011 11:58 PM

I've shelved work on "Charge!" until my Harmony cart ships, and in the meantime I've been playing around with the idea of an RPG. I've never been much of an RPG player, but this thread got me thinking that there might be some opportunities to make a simple-but-fun one for the VCS. I also thought it would be a good opportunity to try to develop a DPC game that was more reliant on the stack, and maybe even something we could work on as a community project.

Here's what I've come up with so far:

Posted Image

Controls:

Right Joystick - Move the active player in four directions. Each move diminishes the "Action Bar" beside the Inventory. Once all moves are complete, the focus shifts to the next character in the player's adventuring party.

Left Joystick - Move the selection cursor (yellow line) to highlight an item from the inventory to use, or change/use the current character's armor and weapon. When an item is selected (by pressing left fire button), use the joystick to move the targeting cursor to the desired target.

Left Fire Button - Equip/use the item the selection cursor is currently highlighting. First press readies the item and brings up the targeting cursor (blinking blue square). Second press activates the item.

Right Fire Button - Cancel item equip/use (eliminates blinking blue targeting cursor)


Dev Notes

I'm thinking gameplay would consist of selecting three characters of any class (using mostly generic fantasy archetypes like "Warrior", "Rogue", "Wizard", etc) to embark on a quest for treasure and kill-points.

Currently, the program stores to and retrieves from the stack the following properties: Character Class, Brawn, Agility, Knowledge, Hit Points, Weapon, Armor, Inventory1 & Inventory2. Most of these are not doing anything useful right now, but when the character focus shifts between your two party members you will see that character's weapon, armor, current hitpoints and inventory loaded from the stack into the bottom part of the display.

The idea of switching out the inactive player characters graphics with playfield pixels is to reduce flicker (either manual or via batari's built-in multiplexing). Ultimately, it would be great to switch in GRP0 graphics on the fly, so that whichever character (whether a player-character or enemy) had the focus would be able to move unrestricted and flicker-free. It might also be a good idea to develop an AI that would avoid placing more than two enemies/items in a row at any given time... but that's neither here nor there at this point. :)

To demonstrate the stack feature is working, you can try walking into any of the enemies. In the full game, this would trigger a combat test, but for now it just depletes the current character's hitpoints. I'm hoping to use the stack in a similar way to load the stats and inventories of on-screen enemies during their turns, and carefully pull up the relevant stats of targets whenever necessary.

The Equip/Use does nothing right now, except to demo the interface itself. The idea is that the left joystick/fire-button is used for equipping and using items and missile weapons, while the left joystick/fire-button is used for moving the characters around the map.

The source is still lame and uncommented, so I'll have to clean it up a bit before posting. One thing that I've been trying - and, so far, failing :lol: - to do is to adapt SeaGTGruff's inventory strip for the DPC. The inventory I cobbled together for this demo is clunky and extremely limited, but a more flexible one would probably enhance gameplay quite a bit. Frankly, there's enough gray-matter flowing around these parts for lots of nice features (Savekey, Vox, etc).

For now, this is more of a mockup and food-for-thought than a true demo, I guess. But part of me feels like together we come come up with a fairly badass VCS RPG.

Attached File  DungeonRaid_demo_082211.bin   32K   49 downloads

"What do you think, sirs?"

Posted Image

Batari DPC+ Sprite Masking?

Tue Jul 19, 2011 6:18 PM

Would it be possible in the batari DPC+ kernel to mask-wrap the multiplexed P1 sprite similar to Demo 4 of the Harmony DPC+ programming thread?

Quote

Demo 4 - Data Writer Demo

* Unlike the DPC cartridge, the DPC+ Display Data ends up in RAM and can be modified at run time.
* Joystick to move snowman - notice when he moves on/off screen he is masked to smoothly enter/exit the display. (compare with Demo 0)
* Fire to flip snowman - this shows the difference between DFxWRITE and DFxPUSH.
* Attached Image: DPC+ demo.bin_4.png

Thanks,
J

Charge!

Tue Jul 19, 2011 4:20 PM

Hey gang,

Haven't signed on in a long while, but I thought I'd share an early demo of what I've been working on. This is a DPC+ kernel adaptation of a project I started a few years ago, although I think this version is different enough to constitute an entirely different game. I'll include the instructions in this first post, and update them with each build.




CHARGE!

by J.D. Kitchen




THE STORY:

The kingdom of Nirata is under attack! Armed with your lance, your bow and your trusty steed, you must defend the realm from the relentless hordes of soldiers, horsemen and fire-breathing dragons.

Patrol the road that encircles your kingdom, using your arrows to slay the dragons in the sky and footmen advancing through the fields. But beware the dragons' fiery breath, the lances of enemy knights, and other deadly hazards and foes which may befall you.



PLAYING THE GAME

Your objective is to destroy marauding Dragons, Wizards and other foes while defending your Castles from harm. You begin the game with three Castles and three Paladins to defend them with. Each Paladin comes equipped with Armor that is gradually depleted by enemy attacks, a Lance for jousting Knights and a magic bow that can fire an unlimited number of arrows into the sky. The number of remaining Armor Points and Paladins is displayed at the bottom of the screen, along with the player's current score.

Use the left joystick to maneuver your Paladin's horse around the dark gray road area. The road is a loop around the kingdom, so moving in one direction long enough will bring you back to where you started. Pressing the joystick's fire button will draw your bow, and releasing it shoots an arrow into the air on a slight forward arc. If you hold the joystick left or right while holding down the fire button, your horse will charge at a fast gallop. Your galloping Paladin will automatically engage his Lance, making it possible for you to kill advancing enemy knights.

Charge! includes multiple attack waves. In each wave, you must first clear the sky of enemies and then destroy any enemies that remain on the road. After the road is cleared of enemies, there will be a brief interlude, during which your castles and armor are repaired slightly, and any bonus men you earned during the wave are applied. After the interlude, the next wave begins, gradually increasing the challenge to the player.

You score points whenever you kill a Dragon, with various breeds earning different point values. As waves progress, you will meet sturdier, faster, and deadlier breeds. You can also score points by killing any other enemy as long, as all of your Castles are still intact. Some waves feature special foes who must be defeated to advance, with unique rewards for doing so.

When a Paladin's Armor Points are fully depleted, the current hero dies. A new one will appear until all your remaining Paladins are lost.

At the beginning of each new wave, the kingdom will fortify itself for the next attack in the following ways:
  • Your Paladin will recover an Armor Point for each surviving Castle.
  • At 500 points, you will recieve a bonus Paladin
  • Each of your surviving Castles will undergo repairs, recovering eight hit points per round.
  • If a Castle was destroyed in the previous wave, the flaming ruins will be extinguished. The Castle's smoking rubble will be able to be rebuilt after the conclusion of the current wave.
The game ends either of the following conditions:
  • You have lost all your remaining Paladins.
  • All of your Castles are destroyed and the current Paladin dies.
Press [Reset] or the left joystick fire button to begin a new game.




CONTROLS:

Joystick - Move horse in 8 directions along the road.
Press Fire Button - Draw bow.
Release Fire Button - Shoot arrow.
Hold Fire Button and Joystick Left/Right - Charge!




SCREEN LAYOUT:


Posted Image
A. Paladin
B. Dragon
C. Dragon's Breath
D. Bats
E. Castle
F. Foot Soldier
G. Knight
H: Armor Remaining
I: Remaining Paladins
J: Score




GAME OBJECTS


THE KINGDOM

The Paladin
Posted Image
The player's Paladin can attack enemies in the fields and the skies by shooting arrows at them, and attack enemies on the road by charging them with his Lance. Arrows can be shot at any time by pressing and releasing the fire button, but the Lance can only be used when the Paladin's horse is moving at full speed. A charging maneuver increases the top speed for the duration that the player holds down the fire button while pressing the joystick in left or right direction. If a player switches the joystick direction mid-charge, the Lance will become inactive again until the horse achieves maximum speed in the new direction. Each Paladin can receive seven wounds before death, indicated by the red bars on either side of the score. A Paladin will heal one Armor Point per Castle that survives a wave.

The Castles
Posted Image Posted Image Posted Image
The primary goal of the game is to defend your kingdom's three Castles: Purple, Yellow and Red. As each Castle takes damage from Dragons and Footmen, it becomes shorter. When its last hit point is lost, it becomes a Flaming Ruin. At the conclusion of each wave, surviving Castles are repaired slightly, while Flaming Ruins turn into Smoking Rubble. Smoking Rubble can be rebuilt into a Castle at the end of the next wave.

Castle Damage States:
Posted Image Posted Image Posted Image

Princesses
If you can defend a Castle well enough, a Princess will appear at the top of it during the Repair Phase. If a Dragon swoops down and captures a Princess, it will attempt to bring her to the top of the screen for a quick snack. Shoot the beast before suppertime, and then rescue the falling damsel for bonus points.
Posted Image Posted Image Posted Image



ENEMIES

Dragon
Posted Image Posted Image
Dragons are the player's primary foe. Sweeping down from the sky, they attempt to bathe the player's Paladins and Castles in flames. There are several breeds of Dragon, distinguished by different colored hides and varying abilities. Dragons travel in packs of between 1 and 5 per wave, attacking the kingdom one at a time. When all the Dragons in the current pack have been slain, the game progresses to the next wave.

Footman
Posted Image Posted Image
Foot Soldiers of various armies and tribes will charge upon the fields to lay siege to your castles. They vary in uniform, speed, number (not implemented yet) and attack strength, but they all share the same purpose: to burn your Castles to the ground! Dispatch them with your arrows, yea, verily.

Bats
(Not implemented)
Posted Image
These flying pests patrol the skies in swarms, attacking any Castles they find along the way.

Knight
Posted Image
Renegade Knights prowl the road, looking to make a name for themselves... by writing it in your Paladin's blood. These horsemen will challenge you continually as you protect your Castles from other foes. To defeat them, look for signs of their approach on the battlefield, align your Lance with theirs, and charge!

Grendel
Posted Image
These large, bloodthirsty monsters occasionally are lured from their lairs by the smell of the Paladin's blood. Grendels have thick hides that are impervious from attack, unless you can locate their weak point. If that wasn't bad enough, they will sometimes lurk just out of your reach alongside the road, and they require two direct lance hits to defeat.

Wizard
Posted Image
The Evil Wizard sails through the skies, wreaking destruction with big blasts of mystical energy. He is a tricky target to hit, and sometimes will use a barrier of green mist to protect himself from your arrows.


TERRAIN
Posted Image Posted Image




TIPS:
    .
  • Listen to the sound of the Dragon's fire and the Soldier's sword to track your enemies' positions (louder equals closer; quieter equals farther away).
  • If one of your Castles is successfully attacked, you will hear an explosion sound.
  • Your bow fires Arrows on a slight forward angle, so try to anticipate a Dragon's movements when firing at one. A good tactic is to try to keep your horse in motion and either match the Dragon's speed or charge beneath it while firing.
  • Enemy Soldiers roam the fields beyond the road, laying siege to any Castle they find. Kill them on sight whenever possible.
  • When a Lance appears on the road at either side of the screen, it means that an enemy Knight is close. The longer the Lance is, the closer the Knight is to your current position.
  • When charging, try to align your Lance to the enemy Knight's Lance to defeat him in a joust. The closer you are to aligning with Enemy Knight's path when you clash, the more likely you are to kill him, and avoid injury yourself.
  • As the waves proceed, Dragons will become faster, more damaging and more durable, sustaining multiple bow hits before death. Enemy Soldiers and Knights will also become faster, stronger and more aggressive as waves progress.
  • Dragons are primarily concerned with destroying your Castles, but with a little coaxing you can lure them away with your Paladin, and get them to come after him instead.
  • You begin the game with three lives (represented by the series of vertical bars next to the the score area). The red bars on either side of in the score represents the current Paladin's Armor Points. Each of your Paladins can sustain seven wounds (either from dragon fire or jousts) before death, at which point a new Paladin is re-spawned at the nearest Castle. If all three Castles are destroyed (either flaming of smoking) and the current Paladin is killed, the game immediately ends, even if more lives are left in reserve.
  • At the conclusion of each wave, each surviving Castle will be rebuilt slightly. If a Castle is destroyed before the end of the wave, you will have to complete an additional wave to wait for the flames to die out and turn into smoke before it can begin being repaired again.
  • Beware of Giant Dragons, Evil Wizards and other powerful foes.
  • The final wave in this demo will repeat until the player loses the game.




Playing in an Emulator:

Since this is DPC+, you'll have to play using the latest Stella build (3.4.1). I'd suggest setting Options> Game Properties>> Display>>> Use Phosphor to "On" (77%) to compensate for flicker.




Playing on Harmony:
I'd be curious to know how the flicker is looking on TVs when both the Paladin and the Knight are on screen.


----
I've deleted all other archived versions, and will start labeling releases with dates from now on. Thanks for any feedback, bug reports or ideas you have to offer. High Scores would also be appreciated, so I can gauge the level of challenge.

Cheers,
Jarod

Newest Version:
Attached File  ChargeDPC_090211.bas.bin   32K   39 downloads