Dungeon Swim: Fish Soup [Serious]


If it doesn't fit anywhere else, it belongs here. Also, come here if you just need to get hammered.

User avatar

Dis Charger

Posts: 2056

Joined: Wednesday, 7th August 2013, 08:25

Post Monday, 1st June 2015, 04:40

Dungeon Swim: Fish Soup [Serious]

Camera Test Alpha is up. Looking for feedback about which camera angle(s) I should optimize for.

Controls:

  • Numpad for Horizontal Move.
  • A/Z + Numpad for Vertical/3D Move.
  • Click Screen to enter mouselook mode.
  • Press Escape to leave MouseLook mode.

Screenshot:
Image

Cameras are:

  • First Person (with Mouse look) [Largest camera].
  • Component: Top, Left, Front [Bottom Three].
  • Corner: Upper,Right,Front.
  • Edge: Upper, Right.

Previous First Post Content Archive:
Spoiler: show
It's time I kicked this project off for serious. Currently working on implementing CubeLoS [I assume CubeLoS would be far better than SphereLoS for obvious reasons.]. Here's a couple early screenshots.

The really short project description is applying Crawl mechanics into 3D space; though no guarantees I'll actually use the same magic elements or skills, races; for now it's just a movement and melee test.

With internal grid and distance fade on. With those effects off.

I can link this alpha if someone really wants to play with JUST movement working and exploration limited to one rather simple testing vault...

EDIT: This is the movement alpha. Feel like I need to decide if/how to use mouselook and what external camera angles I want before continuing. Opinions welcome.

[Thread is CYC because it belongs nowhere else; not because it's not a serious subject, no joke replies. Feature list and changelog will be edited into this post.]
Last edited by bcadren on Thursday, 4th June 2015, 06:44, edited 3 times in total.
I'm beginning to feel like a Cat God! Felid streaks: {FeVM^Sif Muna, FeWn^Dithmenos, FeAr^Pakellas}, {FeEE^Ashenzari, FeEn^Gozag, FeNe^Sif Muna, FeAE^Vehumet...(ongoing)}
User avatar

Tartarus Sorceror

Posts: 1881

Joined: Saturday, 7th September 2013, 21:16

Location: Itajubá, MG, Brazil.

Post Monday, 1st June 2015, 05:33

Re: Dungeon Swim: Fish Soup [Serious]

you really enjoy 3Dificating things, dont you? the same with Snake 3D...
movement will be underwater style, or there will be gravity? maybe subjective gravity like some DnD planes?
my posts are to be read in a mildly playful tone, with a deep, sexy voice.
User avatar

Dis Charger

Posts: 2056

Joined: Wednesday, 7th August 2013, 08:25

Post Monday, 1st June 2015, 07:55

Re: Dungeon Swim: Fish Soup [Serious]

Hirsch I wrote:you really enjoy 3Dificating things, dont you? the same with Snake 3D...
movement will be underwater style, or there will be gravity? maybe subjective gravity like some DnD planes?
Snake3D was a failure. I believe in this one. (Also this one is -a lot- harder, I've never done datasystems this complicated before [it's early but I have to make decisions about how monsters will be handled now or it will be more of a pain to hack them in later].)

Anyways it's literally Crawl in 3D, at least on basic mechanics. When the movement works correctly I'll let you have a look; but basically 1-9 work as normal; a +1-9 adds up to the equation (a + 5 is straight up); z + 1 - 9 adds down to the equation. You can move 26 directions (27 if you count sitting still as a move).

As of right now, it only reads in vaults; I haven't done any random generation, yet and won't until the 'easier' mechanics work (movement, Line of Sight, basic [melee-only] enemy AI). You can make a vault if you like, though at some point I should come up with a better way to do them. A vault right now is an array of images, [red = tile type, green = monster ID for spawning on tile, blue = item ID for spawning on tile]; one image = one vertical layer of the vault. It's a bit much, ASCII in crawl style would be worse; I might need to make an editor...

EDIT: I'm probably doing a mouse-only inventory; arbitrary limit of 52 is arbitrary. (not that there won't be a limit, just not going [oh number of letters on the keyboard is fine!].
I'm beginning to feel like a Cat God! Felid streaks: {FeVM^Sif Muna, FeWn^Dithmenos, FeAr^Pakellas}, {FeEE^Ashenzari, FeEn^Gozag, FeNe^Sif Muna, FeAE^Vehumet...(ongoing)}
User avatar

Pandemonium Purger

Posts: 1315

Joined: Monday, 24th October 2011, 06:13

Post Monday, 1st June 2015, 13:00

Re: Dungeon Swim: Fish Soup [Serious]

bcadren wrote:When the movement works correctly I'll let you have a look; but basically 1-9 work as normal; a +1-9 adds up to the equation (a + 5 is straight up); z + 1 - 9 adds down to the equation.


i knew you`d some up with something simple for movement but i like to use the keyboard only when i play crawl. can you confirm one movement command for every letter on the keyboard? it can be something simple like

  Code:
qwe
asd
zxc

rty
fgh
vbn

uio
jk
lmp


if you count standing still as movement you would need a new letter for the alphabet. nothing is too ambitious though.
seattle washington. friends for life. mods hate on me and devs ignore my posts. creater of exoelfs and dc:pt

For this message the author twelwe has received thanks:
duvessa
User avatar

Ziggurat Zagger

Posts: 5832

Joined: Thursday, 10th February 2011, 18:30

Post Monday, 1st June 2015, 13:46

Re: Dungeon Swim: Fish Soup [Serious]

So... Dwarf Fortress?
"Be aware that a lot of people on this forum, such as mageykun and XuaXua, have a habit of making things up." - minmay a.k.a. duvessa
Did I make a lame complaint? Check for Bingo!
Totally gracious CSDC Season 2 Division 4 Champeen!

Spider Stomper

Posts: 245

Joined: Sunday, 1st March 2015, 19:26

Post Monday, 1st June 2015, 17:48

Re: Dungeon Swim: Fish Soup [Serious]

Instead of true continuous 3d, crawl's mechanics are best suited for "Eye of the Beholder" style gameplay. I think it would be a cool UI.

Slime Squisher

Posts: 330

Joined: Thursday, 10th May 2012, 03:29

Post Monday, 1st June 2015, 18:00

Re: Dungeon Swim: Fish Soup [Serious]

Good luck on the project. I look forward to seeing more mechanics in action!
User avatar

Tartarus Sorceror

Posts: 1881

Joined: Saturday, 7th September 2013, 21:16

Location: Itajubá, MG, Brazil.

Post Monday, 1st June 2015, 20:48

Re: Dungeon Swim: Fish Soup [Serious]

XuaXua wrote:So... Dwarf Fortress?

no, totally different.
bcadren wrote:Snake 3D was a failure

well, I spent way more time playing that than I'm confortable admitting. :lol:
my posts are to be read in a mildly playful tone, with a deep, sexy voice.
User avatar

Ziggurat Zagger

Posts: 5832

Joined: Thursday, 10th February 2011, 18:30

Post Monday, 1st June 2015, 20:56

Re: Dungeon Swim: Fish Soup [Serious]

Hirsch I wrote:
XuaXua wrote:So... Dwarf Fortress?

no, totally different.


Oh right, I forgot that Crawl doesn't have dwarves.
"Be aware that a lot of people on this forum, such as mageykun and XuaXua, have a habit of making things up." - minmay a.k.a. duvessa
Did I make a lame complaint? Check for Bingo!
Totally gracious CSDC Season 2 Division 4 Champeen!
User avatar

Dis Charger

Posts: 2056

Joined: Wednesday, 7th August 2013, 08:25

Post Monday, 1st June 2015, 21:22

Re: Dungeon Swim: Fish Soup [Serious]

twelwe wrote:
bcadren wrote:When the movement works correctly I'll let you have a look; but basically 1-9 work as normal; a +1-9 adds up to the equation (a + 5 is straight up); z + 1 - 9 adds down to the equation.


i knew you`d some up with something simple for movement but i like to use the keyboard only when i play crawl. can you confirm one movement command for every letter on the keyboard?
I know twelve posed this as a joke; but I understand that he has a point. Honestly, I don't even know how crawl deals with this (keyboards without a numpad); I can set up a second default set for that kind of keyboard if people like/need but I'd need suggestions as to what keys to use (that are more feasible) I also can use set the controls to 'Button' variables and allow the player to set which keys do what from a menu instead of just using set Keycodes like I am right now... Instinct for alternative Shift/Ctrl + uiojklm,. but those overlap other crawl shortcuts which could lead to more headaches.

blobbo wrote:Instead of true continuous 3d, crawl's mechanics are best suited for "Eye of the Beholder" style gameplay. I think it would be a cool UI.
I examined the title briefly (watched someone's gameplay on YouTube, didn't play it myself). I'll agree that I like the inventory UI pretty well; but I'm doing this experiment to see how well it works in real 3D, not to apply something tested like that (there are tons of Roguelikes and Action/Roguelike hybrids with mechanics like that out there).

Hirsch I wrote:
Bcadren wrote:Snake 3D was a failure
well, I spent way more time playing that than I'm confortable admitting. :lol:
Yea, I play it again everytime I fetch the link to put in a portfolio (job-seeking) I think it's fun for a few minutes; but unlike normal snake, you don't really tend to understand the shape of the Snake you are leaving behind well enough to play strategically and gain skill. It's too confusing to be a good game. Also, it took about 60 hours to write the code for that...and it made 7 cents [need more like 150,000 views than 1,500 to make ad money; it's pretty bad by Newgrounds standards.] The Ludum Dare project "Toy Soldiers" made about $2.50 (40 hours to make). *shrug* They are decent prototypes, I guess; but in neither case did they get enough attention in that state for me to think it was worth completing them. If you want to talk more about them (or any other project) feel free to PM me (here or Newgrounds).
I'm beginning to feel like a Cat God! Felid streaks: {FeVM^Sif Muna, FeWn^Dithmenos, FeAr^Pakellas}, {FeEE^Ashenzari, FeEn^Gozag, FeNe^Sif Muna, FeAE^Vehumet...(ongoing)}
User avatar

Tartarus Sorceror

Posts: 1891

Joined: Monday, 1st April 2013, 04:41

Location: Toronto, Canada

Post Monday, 1st June 2015, 21:27

Re: Dungeon Swim: Fish Soup [Serious]

bcadren wrote:(keyboards without a numpad)


hjklyubn
take it easy
User avatar

Dis Charger

Posts: 2056

Joined: Wednesday, 7th August 2013, 08:25

Post Wednesday, 3rd June 2015, 01:57

Bresenham Issues

Update: I implemented a variant of Bresenham's line drawing algorithm for use for both the targeting and the LoS. Test Video

I'm seeing two issues from this algorithm:
  1. By iterating the initial error of x/y and x/z planes separately; a -lot- of line variants are created.
    • In vanilla crawl the average raycast attempt has 4-7 potential variants (excluding horizontals, verticals and 45 degree angles, which only have one).
    • By contrast in Dungeon Swim, there may be as many as 49 variants of some lines (7 variants on each plane).
  2. Because x/y and x/z planes are considered separately some of the lines may appear strange when looking from a three-quarters perspective.
    • As this is only an aesthetic issue when looking at the targeting of a ranged weapon; I'll consider it more irrelevant.

For now; I'm not addressing either issue; I'll be only using the initial (default) variant and not manipulating the initial error at all. My concern being that checking multiple raycasts for a single action (especially for current LoS) will result in considerable lagging for an action as simple as a move. [LoS size of 5 already contains 1000 spaces (cubeLoS) with 600 of them being the 'outside' of the cube that require an LoS check. Turning 600 raycasts into 29400 simply isn't reasonable.]

Initial Post (and the Alpha Link) should update with an LoS test alpha within 2 hours maximum.

Also: Arrhythmia. If you explain how your control scheme would function I'll implement it, but I don't understand it as is.
I'm beginning to feel like a Cat God! Felid streaks: {FeVM^Sif Muna, FeWn^Dithmenos, FeAr^Pakellas}, {FeEE^Ashenzari, FeEn^Gozag, FeNe^Sif Muna, FeAE^Vehumet...(ongoing)}
User avatar

Tartarus Sorceror

Posts: 1891

Joined: Monday, 1st April 2013, 04:41

Location: Toronto, Canada

Post Wednesday, 3rd June 2015, 02:03

Re: Bresenham Issues

bcadren wrote:Also: Arrhythmia. If you explain how your control scheme would function I'll implement it, but I don't understand it as is.


it's how crawl deals with keyboards without numpads. you asked!
take it easy

Blades Runner

Posts: 552

Joined: Tuesday, 10th April 2012, 21:11

Post Wednesday, 3rd June 2015, 04:52

Re: Dungeon Swim: Fish Soup [Serious]

vi keys for the win. Bcadren, you might possibly make the first 3D game to use vi keys?
User avatar

Crypt Cleanser

Posts: 689

Joined: Sunday, 3rd June 2012, 13:10

Post Wednesday, 3rd June 2015, 05:29

Re: Bresenham Issues

bcadren wrote:Update: I implemented a variant of Bresenham's line drawing algorithm for use for both the targeting and the LoS. Test Video

I'm seeing two issues from this algorithm:
  1. By iterating the initial error of x/y and x/z planes separately; a -lot- of line variants are created.
    • In vanilla crawl the average raycast attempt has 4-7 potential variants (excluding horizontals, verticals and 45 degree angles, which only have one).
    • By contrast in Dungeon Swim, there may be as many as 49 variants of some lines (7 variants on each plane).
  2. Because x/y and x/z planes are considered separately some of the lines may appear strange when looking from a three-quarters perspective.
    • As this is only an aesthetic issue when looking at the targeting of a ranged weapon; I'll consider it more irrelevant.

For now; I'm not addressing either issue; I'll be only using the initial (default) variant and not manipulating the initial error at all. My concern being that checking multiple raycasts for a single action (especially for current LoS) will result in considerable lagging for an action as simple as a move. [LoS size of 5 already contains 1000 spaces (cubeLoS) with 600 of them being the 'outside' of the cube that require an LoS check. Turning 600 raycasts into 29400 simply isn't reasonable.]


I don't really see why you need to do LOS this way in an already 3d game?

But anyway, most of the raytracing of permissive LoS can be precomputed at compile time and stored in bit arrays. You're going to need a big lookup table, but the speed will be very good.
Dearest Steve
thanks for the gym equipment
the plane crashed

Shoals Surfer

Posts: 299

Joined: Wednesday, 15th May 2013, 18:04

Post Wednesday, 3rd June 2015, 17:04

Re: Dungeon Swim: Fish Soup [Serious]

Arrhythmia wrote:
bcadren wrote:(keyboards without a numpad)


hjklyubn

Isn't this the normal way to move in crawl? I have a keypad but I wouldn't ever use it for movement. using hjklyubn seamlessly integrates with using other keyboard commands - with both hands on the keyboard at all times, it's just like typing.
User avatar

Dis Charger

Posts: 2056

Joined: Wednesday, 7th August 2013, 08:25

Post Thursday, 4th June 2015, 01:35

Re: Dungeon Swim: Fish Soup [Serious]

Been having some real issues with normal LoS; First prototype being delayed by some serious bughunting. If you wish to be amused by how much of an idiot I am here's a video of the current state of it failing. [The first Octant is behaving as expected the others are having various levels of failure; I'm sure it's sign problems in the linedraw/raycast algorithm. [I'm calling it linedraw because it's not the built in Raycast that draws a Euclidean ray, but a Bresenham line instead.]

I did think about plans on this project while AFK for a bit; I don't want to go too far into it, in case it doesn't work completely (not I can't make the game work mechanically, but even the basics not being fun); but:

Races:
  • Merfolk - The game's "Human" average at everything. Two rings, amulet, armour, weapon, shield, helmet. Only weapons available will be polearms (for early).
  • Octopode - High dex. Boosts to stealth, dodge and unarmed. Eight rings, can use weapons, but awkward with them. Magically talented.

Areas:
  • Swamp - Full of plants; relatively shallow. Contains attackers that can strike from land.
  • Sunken Temples - Traditional roguelike 'room' generation used in some, also columns, hallways. Going to creates a temple first for ease.
  • Open Ocean - Primary walls apart from the seabed are plants. Enemies get stronger at lower depths. (like the mainline crawl, only no transition between floors, being able to dive anywhere.)
  • Reef - Tight winding tunnels, stationary enemies.
  • Trench - Low light limits your LoS, but not that of enemies. (Will get the drop on you by about two tiles). Full of undead and creepy creatures.

Magic Schools:
  • Earth - Works as normal. Going to confirm LRD ahead of time.
  • Water - Replaces air. Focus on flows and movement.
  • Ice - Switches to a focus on creating things. Make a javelin of ice and throw it, place a block of ice to obstruct the view.
  • Fire - Highly unstable and short lived. Explosions like Fireball only.

Gods: Plan on using them. Probably implement Fedhas Madash first if I'm doing Crawl gods. I'm probably -not- going to implement a lot of the simpler gods (Sif Muna, Makhleb) and may or may not have a temple-like area. Area transitions will be a little of a challenge as it is. This is last in priority of all key mechanics after inventory; enemies and level generation though.

Anyways:

Arrhythmia: I'll put them in as a second default (probably with Shift/Ctrl for Up/Down) Only reasons I didn't use Shift/Ctrl for the main set was...on a lot of keyboards they make the numpad do other things. (Page Up/Page Down, etc.)

Pubby wrote:I don't really see why you need to do LOS this way in an already 3d game?

But anyway, most of the raytracing of permissive LoS can be precomputed at compile time and stored in bit arrays. You're going to need a big lookup table, but the speed will be very good.


Pubby: You mean pretest every possible combination and have the data for that combination available as a BitArray or do all of the LoS tests on level generation?

The latter I don't particularly being any more efficient than testing on move it just frontloads the calculations (still need to be done at playtime because level generation isn't ahead of time; the former is a lot of tests, it'd have to parse back through. Suppose it's still less tests than actually performing all the raycasts at playtime, but it's a lot of data; even as bit arrays LoS of 5 (what I'm sticking to for now) contains 1330 spaces (excluding the player) which leads to google calculator is saying infinity combinations; 2^1330, I can't say I disagree it's going to be too much to have in memory. Suppose if you did it by Octant that would reduce to 216 spaces or about 1e65 combinations, but still too much to consider precalculating every combination. 3D squares the amount of data needed for everything. O_O;

Suppose I could write a daemon to automatically do it in the background while playing so there's no visible lag on move; but that'll come relatively late, because I don't see it providing that much optimization, unless there is a usage case I'm missing. I can see storing all the correct orders to check (the rays) as lists of offsets ahead of time (Vector3[]; not BitArray) and that providing some optimization, by using some memory instead of calculations, but even that isn't optimizing that much and could be quite the memory cost.

I need LoS, because:
  1. For now I'm copying Crawl's core mechanics exactly; so enemies could only attack you if they are in your LoS; thus this calculation decides what you can see as well as what sees you.
  2. In general what the player can and can't target needs to be calculated; this is a turn-based game and not an action one, so 'what the player can actually see' isn't the deciding factor.
As to just using the 3D engine for what the player can actually see; maybe. I'll have to write some shaders for it though.
  • The key feature that needs to be different is that the attenuation from point lights needs to be based on Chebyshev distance, instead of Euclidean.
  • Also for external cameras the Opacity needs to vary with distance and a few other factors to make the outside views more reasonable.

The way I'm handling it now is just turning the graphics completely off when not in LoS. Later on, I know I'm going to need to make a larger map; and for that I'm going to need something more than cubes. I do think that just using cubes near the player is reasonable enough; but for a larger map using planes with submeshes makes a lot more sense to save on drawcalls and vertex counts. [Reason I'm saying cubes is fine for within LoS is that with the LoS changing the graphics need to change faster and so far there haven't been any issues with 4096 cubes (current count).]

There's a lot left to worry about before trying to optimize the topology to make it easier on the renderer. A nice looking LoS via shaders would also be a cool art feature; but it's not a priority compared to mechanics working.

Anyways. I'll upload a new alpha as a cameras test when the current iteration of LoS (and likely the only one for control purposes for awhile) works. Unsure which camera angles to use ultimately and I do want to allow mouse look in the main window, but am unsure how to do that without it screwing with which direction is which from the player's PoV).
I'm beginning to feel like a Cat God! Felid streaks: {FeVM^Sif Muna, FeWn^Dithmenos, FeAr^Pakellas}, {FeEE^Ashenzari, FeEn^Gozag, FeNe^Sif Muna, FeAE^Vehumet...(ongoing)}
User avatar

Pandemonium Purger

Posts: 1315

Joined: Monday, 24th October 2011, 06:13

Post Thursday, 4th June 2015, 01:48

Re: Dungeon Swim: Fish Soup [Serious]

when is beta?
seattle washington. friends for life. mods hate on me and devs ignore my posts. creater of exoelfs and dc:pt
User avatar

Dis Charger

Posts: 2056

Joined: Wednesday, 7th August 2013, 08:25

Post Thursday, 4th June 2015, 03:03

Re: Dungeon Swim: Fish Soup [Serious]

twelwe wrote:when is beta?
I can't answer that; wish I could but some of the work involved goes under the 'never exactly done anything like this' category and I've already had a major bug occurrence. So 2-3 weeks as a guess. For a More Detailed answer, I typed up my to do list from my notebook for you.
I'm beginning to feel like a Cat God! Felid streaks: {FeVM^Sif Muna, FeWn^Dithmenos, FeAr^Pakellas}, {FeEE^Ashenzari, FeEn^Gozag, FeNe^Sif Muna, FeAE^Vehumet...(ongoing)}
User avatar

Dis Charger

Posts: 2056

Joined: Wednesday, 7th August 2013, 08:25

Post Thursday, 4th June 2015, 05:57

Re: Dungeon Swim: Fish Soup [Serious]

Sorry to double post, but Camera Test Alpha is up. Looking for feedback about which camera angle(s) I should optimize for.

Controls:

  • Numpad for Horizontal Move.
  • A/Z + Numpad for Vertical/3D Move.
  • Click Screen to enter mouselook mode.
  • Press Escape to leave MouseLook mode.
I'm beginning to feel like a Cat God! Felid streaks: {FeVM^Sif Muna, FeWn^Dithmenos, FeAr^Pakellas}, {FeEE^Ashenzari, FeEn^Gozag, FeNe^Sif Muna, FeAE^Vehumet...(ongoing)}

For this message the author bcadren has received thanks:
n1000
User avatar

Slime Squisher

Posts: 397

Joined: Thursday, 1st March 2012, 01:42

Post Thursday, 4th June 2015, 12:30

Re: Dungeon Swim: Fish Soup [Serious]

Will this game support dance pads as complementary input method?

For this message the author Pereza0 has received thanks:
Arrhythmia

Slime Squisher

Posts: 330

Joined: Thursday, 10th May 2012, 03:29

Post Thursday, 4th June 2015, 17:25

Re: Dungeon Swim: Fish Soup [Serious]

When the camera is nearly vertical, moving the mouse further up or down (towards vertical) can make it twitch and seem to spin to a new direction which makes orienting difficult. Separately, I wonder if a third-person, rotatable camera would be more appropriate.
User avatar

Crypt Cleanser

Posts: 689

Joined: Sunday, 3rd June 2012, 13:10

Post Friday, 5th June 2015, 03:47

Re: Dungeon Swim: Fish Soup [Serious]

Pubby: You mean pretest every possible combination and have the data for that combination available as a BitArray or do all of the LoS tests on level generation?

The latter I don't particularly being any more efficient than testing on move it just frontloads the calculations (still need to be done at playtime because level generation isn't ahead of time; the former is a lot of tests, it'd have to parse back through. Suppose it's still less tests than actually performing all the raycasts at playtime, but it's a lot of data; even as bit arrays LoS of 5 (what I'm sticking to for now) contains 1330 spaces (excluding the player) which leads to google calculator is saying infinity combinations; 2^1330, I can't say I disagree it's going to be too much to have in memory. Suppose if you did it by Octant that would reduce to 216 spaces or about 1e65 combinations, but still too much to consider precalculating every combination. 3D squares the amount of data needed for everything. O_O;

Suppose I could write a daemon to automatically do it in the background while playing so there's no visible lag on move; but that'll come relatively late, because I don't see it providing that much optimization, unless there is a usage case I'm missing. I can see storing all the correct orders to check (the rays) as lists of offsets ahead of time (Vector3[]; not BitArray) and that providing some optimization, by using some memory instead of calculations, but even that isn't
optimizing that much and could be quite the memory cost.

You pre-compute the bressenham lines to enable fast raytracing. Collisions aren't precomputed.

I'm not really sure where you're getting 2^1330 from. I never was able to figure out the formula for determining the maximum finite number of rays needed for permissive vision, but I do know that it's not a power of two. For my 17x17 LoS square, I needed exactly 76 rays. That's quite small.

Anyway, I'll explain it again from the top.

A simple way of doing LoS involves tracing rays outwards from the player. Unfortunately this is not very fast, mostly because you end up checking spaces close to the player several times over. Now, one thing to note is that the quality of the LoS is determined by the number of rays you cast. It is possible to cast a small amount of rays that pass through every space in view, or you can cast every possible unique ray. For your purposes, the former should be sufficient.

The bit array technique will work for any number of rays that you want. The optimization means that every space gets checked once for visibility, and is overall much friendlier to the processor than bressenham lines. The optimization works by assigning each ray a bit inside a larger bit array. A 1 means that the ray hasn't hit a wall; a 0 means it has. You iterate through each space of your LoS once, changing bits to 1 when you come across walls. The lookup table contains which rays pass through which spaces.

Sorry if this wasn't explained fully; I just don't have time to write a whole article on the subject. I can show you some code though, although it might not be very useful either.

Some comments I wrote in the program that generates the lookup table.
  Code:
// This file generates a lookup table for a fast permissive field of view
// algorithm.
//
// The table is in the octant shaded by '#':
// +-x------>
// y\########
// | \#######
// |  \######
// |   \#####
// v    \####
//
// A higher-level description of the algorithm is as follows:
// We begin by finding every unique "ray" in the octant.
// The rays start at the origin and emanate outwards.
// We give each ray a unique index number to identify it.
// Then, for every coordinate that the ray passes through, we add the ray's
// index to a set belonging to that coordinate.
//
// Finding the LOS is easy with this array of sets: Iterate every coordinate
// in the the octant starting from the center and moving outwards.
// If the coordinate contains a wall, look at what rays belong in its set.
// Since you are iterating outwards, you now know that every ray in that
// set will be blocked in future iterations too. Thus, every ray in that
// set can be considered "dead". Now, for future iterations, the "live"
// rays of a coordinate will be the set belonging to the coordinate _minus_
// the set of previously iterated "dead" rays. If a coordinate has zero "live"
// rays, then it will not be visible.
//
// In practice, this algorithm can be done efficiently using bitwise
// operations. Each ray is given a unique bit flag, and each coordinate set
// is represented by the bitwise OR of every passing ray's flag.
// Calculating the LOS uses bitwise 'AND's to compare "dead" rays to "live"


This is the code that happens at runtime. Just an iteration through each point in the LoS square.
  Code:
    int x;
    int y;
    int* cx = &x;
    int* cy = &y;
    do
    {
        for(int sy = -1; sy <= 1; sy += 2)
        for(int sx = -1; sx <= 1; sx += 2)
        {
            auto alive_set = los_table::bitset_t::make_all_true();
            for(x = 0; x <= los_radius; ++x)
            for(y = 0; y <= x; ++y)
            {
                auto this_set = los_table::at(x,y) & alive_set;
                coord crd = where + coord{*cx * sx, *cy * sy};
                bool const is_in_bounds = in_bounds(crd, bounds);
                if(any_bit_set(this_set)
                   && (!is_in_bounds || !m_vf(crd)))
                {
                    alive_set &= ~los_table::at(x,y); // mark dead
                }
                if(is_in_bounds)
                    m_ray_sets[index(crd)] = this_set;
            }
        }

        // Reverse x and y coordinates to do the other 4 octants
        std::swap(cx, cy);
    }
    while(cx == &y);
Dearest Steve
thanks for the gym equipment
the plane crashed
User avatar

Dis Charger

Posts: 2056

Joined: Wednesday, 7th August 2013, 08:25

Post Friday, 5th June 2015, 05:51

Re: Dungeon Swim: Fish Soup [Serious]

n1000 wrote:When the camera is nearly vertical, moving the mouse further up or down (towards vertical) can make it twitch and seem to spin to a new direction which makes orienting difficult. Separately, I wonder if a third-person, rotatable camera would be more appropriate.
Yea, that's because I quick and dirty intentionally gimbal locked the Z axis to allow the X and Y to act more intuitively. Eulers seem intuitive at first, but they never act like you expect them to. Mouselook is probably staying so I'll have to code something more permanent with Quaternions.

pubby: Ehh; there are 1330 spaces in a Radius == 5 3DCubeLoS. It would take a total of 638 rays to include all of them. (2^1330 was the total count of possible on/off bits.) 3D always makes extremely high numbers. Right now, I think it's an unnecessary optimization, but I could do something later.

Anyways: This might go back on hold for a bit. I...don't know. My blast of faith in myself and in this concept doing well disappeared and I'm unsure of it being viable again (IE if it would be fun even if I finished it); I'm probably going to divert my efforts for a bit, maybe. I...
I'm beginning to feel like a Cat God! Felid streaks: {FeVM^Sif Muna, FeWn^Dithmenos, FeAr^Pakellas}, {FeEE^Ashenzari, FeEn^Gozag, FeNe^Sif Muna, FeAE^Vehumet...(ongoing)}

Dungeon Master

Posts: 634

Joined: Sunday, 22nd September 2013, 14:46

Post Friday, 5th June 2015, 13:19

Re: Dungeon Swim: Fish Soup [Serious]

Crawl does this, FWIW (though it uses quadrants rather than octants).
User avatar

Pandemonium Purger

Posts: 1315

Joined: Monday, 24th October 2011, 06:13

Post Tuesday, 9th June 2015, 21:56

Re: Dungeon Swim: Fish Soup [Serious]

bump
seattle washington. friends for life. mods hate on me and devs ignore my posts. creater of exoelfs and dc:pt
User avatar

Dis Charger

Posts: 2056

Joined: Wednesday, 7th August 2013, 08:25

Post Wednesday, 10th June 2015, 03:50

Re: Dungeon Swim: Fish Soup [Serious]

twelwe wrote:bump
Twelve: Man, IDK. I fell out of faith in '3D Roguelike' as a good design idea

I was looking to explore it because the only example of someone attempting it before that was published Eben Howard's EmoSquid has such glaring interface issues it's almost unplayable (first time I started an attempt at a 3D Roguelike I rand into the same issue and scrapped it at ~4 hours work as I couldn't think of a way to fix it. But, I think it was Crefossus of #Ludumdare on Afternet.org came up with an interesting solution and I'd long bookmarked that idea (neither of us were really using it) to implement later. I thought that with a good interface, triple axis movement might make for something interesting that other Roguelikes can't offer. But after getting to where I know how to fix the interface and putting together a pretty basic mockup, I just think it makes Roguelikes, an already complicated genre, unnecessarily more complex and I'm unsure I want to continue. Notostraca of #rgrd on QuakeNet.org posited that by using water level manipulation, currents thin tunnels (so full LoS viewing is rare, since aforementioned 1330 datapoints is too much for the average player to keep track of reasonably, while a shorter LoS feels claustrophobic) and full embracing the water theme it could be made cool; IDK about my own faith though.

At very least it kickstarted me into being productive again. Since then:
  1. I reopened my old Newgrounds API interface implementation for Unity and updated it to version 5.1 standards and added an error handling clause (two pushes to gitHub, but it's currently a single file repo and I'm the only one that's edited it, so not terribly much to track); I intend to actually finish it now. Mine is one of two partial API integrations (the other is by CoolBoyMan on Newgrounds) neither handles complex saveFile management, or has default features for medal popups and loading high score tables into the game; like the flash version does, and I wanted to complete the package. Though it's going to take both combing the source of the Flash version and packetsniffing to read what the normal flash package sends and what the server sends back in order to manually decrypt them.
  2. Reposted my old portfolio to try to either collaborate professionally or find actual employee again. Only respondent that wasn't complete crap was offering minimum wage + 10% ownership of the game to do technical art work (shaders, lighting, effects). I may end up doing that, unsure how much I believe in the game doing well, it worked well enough, but apart from flavour it was a pretty cookie-cutter space shooter; but I'd be willing to work on it for the sake of being part of something that's already approved for PSN release. Most the rest where people with no experience at all expecting to get a programmer for free *rolls eyes*; one actually seemed like a nice gentleman, but was working on a massive MMO that by his admission wouldn't get to alpha state until sometime Q2 next year, that kind of slow development cycle isn't reasonable for an indie (especially if you are trying to offer revshare instead of upfront payment). Counting the one I may actually do; I spent about 6 hours talking to people.
  3. Agreed to do the networking code for a really weird pig-themed minigame. I doubt the game will be popular, to-be-honest; it's just a clone of some of the minigames from Crash Dash to be released for free. It'll be pretty for a free online game (at least in the fact that few online games use professional 3D art); but it's still just a simple clone; Only agreeing to it, because I feel like it could be done quickly and when it's over the result would prove I could handle a network lobby and peer-to-peer action coding; wthe later of which is one of the hardest things in game networking.
  4. Did some player-doll sprites for crawl. A decision, I now regret. And it seems like the only result was being kicked and fielding some thinly veiled insults via IRC. I know I sometimes post half-assed ideas off the top of my head; but I'm really not a jackass and I was actually wanting to help. I was looking to actually contribute for once, my experience obviously doesn't count for shit anywhere; so I thought maybe getting some C++ patching might count for something, at least I could legitimately list a new coding language on my resume and MAYBE get some references to that fact.
  5. On the good side; a conversation with Lasty in PMs afterword got me to thinking about crawl from design absolutes, which I rarely do anymore, falling into the fixating on flavour nonsense that half the tavern does and I finished the old review I started back in February out of that, out of a combo of thinking clearly about crawl for the first time in awhile and anger about aforementioned insults.

In short, I feel kind of shitty. I'm a lonely guy, who despite a college degree, had a best bid of minimum + revshare. So, for once, could you be clear as to whether your bump is a 'hey, I want you to update this, because I want to see the game finished; it's an interesting idea.' or 'haha, you gave up on your dreams again!'
I'm beginning to feel like a Cat God! Felid streaks: {FeVM^Sif Muna, FeWn^Dithmenos, FeAr^Pakellas}, {FeEE^Ashenzari, FeEn^Gozag, FeNe^Sif Muna, FeAE^Vehumet...(ongoing)}

For this message the author bcadren has received thanks:
Rast

Ziggurat Zagger

Posts: 6180

Joined: Tuesday, 30th October 2012, 19:06

Post Wednesday, 10th June 2015, 04:22

Re: Dungeon Swim: Fish Soup [Serious]

Hmm, if going from 2d to 3d makes roguelikes worse, then clearly, gong to 1d would make it better?
Spoiler: show
This high quality signature has been hidden for your protection. To unlock it's secret, send 3 easy payments of $9.99 to me, by way of your nearest theta band or ley line. Complete your transmission by midnight tonight for a special free gift!
User avatar

Dis Charger

Posts: 2056

Joined: Wednesday, 7th August 2013, 08:25

Post Wednesday, 10th June 2015, 04:31

Re: Dungeon Swim: Fish Soup [Serious]

Siegurt wrote:Hmm, if going from 2d to 3d makes roguelikes worse, then clearly, gong to 1d would make it better?
It's a levels of complexity; kind of thing. In game design, you have to consider what control you aren't giving the player as much as you consider what you do. In my own mind, DOOM is a better game than a modern FPS, because of this kind of principle. In DOOM, you don't have to worry about aiming and you don't regenerate your health over time; thus you have to focus on motion (running and gunning) and you never really have to stop and aim, like you would in a modern title. Adding an additional dimension grants the player more control, but also more that they HAVE TO control and think about in order to play reasonably well, and I'm consider that the added complexity wouldn't make the game better. That said; 1D roguelikes are fine. I mean Linesprint is fun, isn't it? It's simpler than main crawl, but it works pretty well. Having the positioning control of 2D is a layer of complexity that I think adds more than it takes away; but having 'depths' and an LoS that can contain more than 1000 squares easily (but probably not that many enemies because that would be insane); changes the design absolutes so much, you have to think about what the player will now be thinking about in order to make it a reasonable game. That said, it'd literally take 27 creatures to surround you, so it's almost impossible to be complete surrounded and unable to run away (if enemies are the same speed or slower than you); which is a significant difference. I'm really unsure if I like the idea though or how it would actually play out; I do know that it would be a lot of work to actually make work well. More so than a traditional roguelike for the sheer fact that it's in an unexplored design space and I have to figure out how to fill that well and in this case; I'm like an artist staring at a blank canvas; IDK how I could fill that in.
I'm beginning to feel like a Cat God! Felid streaks: {FeVM^Sif Muna, FeWn^Dithmenos, FeAr^Pakellas}, {FeEE^Ashenzari, FeEn^Gozag, FeNe^Sif Muna, FeAE^Vehumet...(ongoing)}
User avatar

Pandemonium Purger

Posts: 1315

Joined: Monday, 24th October 2011, 06:13

Post Wednesday, 10th June 2015, 04:34

Re: Dungeon Swim: Fish Soup [Serious]

bcadren wrote:
twelwe wrote:bump
Twelve: Man, IDK. I fell out of faith in '3D Roguelike' as a good design idea

I was looking to explore it because the only example of someone attempting it before that was published Eben Howard's EmoSquid has such glaring interface issues it's almost unplayable (first time I started an attempt at a 3D Roguelike I rand into the same issue and scrapped it at ~4 hours work as I couldn't think of a way to fix it. But, I think it was Crefossus of #Ludumdare on Afternet.org came up with an interesting solution and I'd long bookmarked that idea (neither of us were really using it) to implement later. I thought that with a good interface, triple axis movement might make for something interesting that other Roguelikes can't offer. But after getting to where I know how to fix the interface and putting together a pretty basic mockup, I just think it makes Roguelikes, an already complicated genre, unnecessarily more complex and I'm unsure I want to continue. Notostraca of #rgrd on QuakeNet.org posited that by using water level manipulation, currents thin tunnels (so full LoS viewing is rare, since aforementioned 1330 datapoints is too much for the average player to keep track of reasonably, while a shorter LoS feels claustrophobic) and full embracing the water theme it could be made cool; IDK about my own faith though.

At very least it kickstarted me into being productive again. Since then:
  1. I reopened my old Newgrounds API interface implementation for Unity and updated it to version 5.1 standards and added an error handling clause (two pushes to gitHub, but it's currently a single file repo and I'm the only one that's edited it, so not terribly much to track); I intend to actually finish it now. Mine is one of two partial API integrations (the other is by CoolBoyMan on Newgrounds) neither handles complex saveFile management, or has default features for medal popups and loading high score tables into the game; like the flash version does, and I wanted to complete the package. Though it's going to take both combing the source of the Flash version and packetsniffing to read what the normal flash package sends and what the server sends back in order to manually decrypt them.
  2. Reposted my old portfolio to try to either collaborate professionally or find actual employee again. Only respondent that wasn't complete crap was offering minimum wage + 10% ownership of the game to do technical art work (shaders, lighting, effects). I may end up doing that, unsure how much I believe in the game doing well, it worked well enough, but apart from flavour it was a pretty cookie-cutter space shooter; but I'd be willing to work on it for the sake of being part of something that's already approved for PSN release. Most the rest where people with no experience at all expecting to get a programmer for free *rolls eyes*; one actually seemed like a nice gentleman, but was working on a massive MMO that by his admission wouldn't get to alpha state until sometime Q2 next year, that kind of slow development cycle isn't reasonable for an indie (especially if you are trying to offer revshare instead of upfront payment). Counting the one I may actually do; I spent about 6 hours talking to people.
  3. Agreed to do the networking code for a really weird pig-themed minigame. I doubt the game will be popular, to-be-honest; it's just a clone of some of the minigames from Crash Dash to be released for free. It'll be pretty for a free online game (at least in the fact that few online games use professional 3D art); but it's still just a simple clone; Only agreeing to it, because I feel like it could be done quickly and when it's over the result would prove I could handle a network lobby and peer-to-peer action coding; wthe later of which is one of the hardest things in game networking.
  4. Did some player-doll sprites for crawl. A decision, I now regret. And it seems like the only result was being kicked and fielding some thinly veiled insults via IRC. I know I sometimes post half-assed ideas off the top of my head; but I'm really not a jackass and I was actually wanting to help. I was looking to actually contribute for once, my experience obviously doesn't count for shit anywhere; so I thought maybe getting some C++ patching might count for something, at least I could legitimately list a new coding language on my resume and MAYBE get some references to that fact.
  5. On the good side; a conversation with Lasty in PMs afterword got me to thinking about crawl from design absolutes, which I rarely do anymore, falling into the fixating on flavour nonsense that half the tavern does and I finished the old review I started back in February out of that, out of a combo of thinking clearly about crawl for the first time in awhile and anger about aforementioned insults.

In short, I feel kind of shitty. I'm a lonely guy, who despite a college degree, had a best bid of minimum + revshare. So, for once, could you be clear as to whether your bump is a 'hey, I want you to update this, because I want to see the game finished; it's an interesting idea.' or 'haha, you gave up on your dreams again!'


ah :|
seattle washington. friends for life. mods hate on me and devs ignore my posts. creater of exoelfs and dc:pt
User avatar

Tartarus Sorceror

Posts: 1891

Joined: Monday, 1st April 2013, 04:41

Location: Toronto, Canada

Post Wednesday, 10th June 2015, 05:06

Re: Dungeon Swim: Fish Soup [Serious]

Siegurt wrote:Hmm, if going from 2d to 3d makes roguelikes worse, then clearly, gong to 1d would make it better?


having played linesprint, i assure you, it does not.

though i've heard one-way heroics is good!
take it easy

Return to Crazy Yiuf's Corner

Who is online

Users browsing this forum: Google [Bot] and 4 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.