Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Polio Vax Scene
Apr 5, 2009



Trying to get good looking lightning using really small recursive methods. I think it looks pretty good.

Adbot
ADBOT LOVES YOU

kaempfer0080
Aug 22, 2011


Certified Weeb

I made a remake of Yar's Revenge for the Atari in Java for a class. I named it Char's Revenge.



It was a fun project but I can't help but feel my code wasn't quite a sterling avatar of the OO paradigm. I had a game object that kept track of things like collision detection and held all the objects like the shield and enemy. That much I think is fine, but I also had dozens of methods that would just call methods on the games objects, so other classes could interact with them. Things like:

public void shieldFunction(){
doFunctionOfShield();
}

So that some other object could interact with another, if you know what I mean.

As a very green programmer I just couldn't think of another way of doing it, and I'm not even sure if it's a poor practice, but the phrase "catapillar programming" comes to mind.

DeathBySpoon
Dec 17, 2007

I got myself a paper clip!


Toying around with Android development for the first time, so I'm making a roguelike in libgdx. Item / world interactions work, inventory works, combat and pathfinding work, and its starting to get to a playable state. I'm already reading tile types and items from XML but I need to do the same for enemies. After that, I just need to get equipment working, and I'll be ready to do the fun part- world generation. It's not actually going to be fantasy themed, so it'll look totally different, but I'm enjoying the project a lot so far. I'm trying to avoid the usual information overload style of roguelikes and instead offer context sensitive interaction- tapping on a tile will perform the default action for whatever it contains, while a tap hold will bring up a list of all possible interactions. It works pretty well so far.

kaempfer0080
Aug 22, 2011


Certified Weeb

DeathBySpoon posted:

stuff

How have you approached controls when developing for Android? A lot of the pograms I've made seem like good things to port to Android for practice but touch screens require a whole different strategy.

Has it been annoying for you or is it much easier when you're designing for Android as opposed to porting?

steckles
Jan 14, 2006

Manslaughter posted:

Trying to get good looking lightning using really small recursive methods. I think it looks pretty good.


These look sweet. What's the method exactly?

Polio Vax Scene
Apr 5, 2009



steckles posted:

These look sweet. What's the method exactly?

Whipped up in GM but you get the general idea:
code:
//bolt(x,y,len,dir)
var _length,_dir,_x0,_y0,_x1,_y1;
if (argument2 > 0) {
    _x0 = argument0;
    _y0 = argument1;
    _length = argument2;
    _dir = argument3;
    while (_length > 0) {
        _x1 = floor(_x0);
        _y1 = floor(_y0);
        _x0 += cos(_dir/360*pi*2);
        _y0 += -sin(_dir/360*pi*2);
        _length -= 1;
        if (_x1 <> floor(_x0) || _y1 <> floor(_y0)) { //only draw in a new pixel
            draw_set_alpha(_length/350);
            draw_point_color(_x1,_y1,c_white);
            _dir = argument3+random(120)-60;
            if (random(1) > .98) { //split
               bolt(_x1,_y1,_length*.5,argument3+random(120)-60);
            }
            if (random(1) > .95) { //bend
               bolt(_x1,_y1,_length,argument3+random(120)-60);
               _length = 0;
            }
        }
    }
}

Xerol
Jan 13, 2007


Been working on my RPG some more.


Messing around with the archer's attack range, it's based on height differences, which also generally for some reason makes somewhat sensible line-of-sight decisions.


Added some indicators of where a move or attack order is coming from/going to.


This is only ever a problem with big hills but is it really a problem?

dizzywhip
Dec 23, 2005

Manslaughter posted:

Whipped up in GM but you get the general idea:

This is pretty awesome so I whipped up a highly inneficient HTML5 Canvas version in CoffeeScript with some fancy animation effects.

Edit: And here's a pixelly "retro" version.

dizzywhip fucked around with this message at 23:28 on May 3, 2012

Suran37
Feb 28, 2009

Manslaughter posted:

Whipped up in GM but you get the general idea.

What does the "<>" stand for or do?

jonypawks
Dec 1, 2003

"Why didn't you tell me you were the real Snake?" -- Ken

Suran37 posted:

What does the "<>" stand for or do?

In some languages <> means not equal, not sure about GM but that's what I'd guess.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

Pfhreak posted:

I continue to crack away at Marathon's map format in my spare time. I now render it using actual WebGL calls (gl.drawElements) rather than 2D canvas calls. Also, I can read the polygon type (water, platform, etc.) and respond accordingly. I'm incorrectly rendering secret doors, landscaped textured polys, and a few other things, but it's a solid first cut I think.

I have the first cut at getting the lines in, but again, it's a first cut. I'm not properly ignoring lines between similar elevations, or the bolding the lines on the edge of the map.



Exploring all this is incredibly cool and rewarding. WebGL is surprisingly different than the version of OpenGL used in Aleph One which is forcing me to actually understand both the OpenGL and the WebGL. The fact that javascript isn't strongly typed is making the code considerably simpler -- that and I don't need to hack in support for different platforms or SDL.

It's been a while since I posted my progress on this, but here's the latest screenshot:



You'll see I now can render the level geometry, texture it, and apply lighting to it. Getting the lights to behave just like they did in the original engine took a little bit of doing, so I went ahead and recorded a (crappy low quality) video of them in action:

http://www.youtube.com/watch?v=i8Me6KZQ-iw New higher quality video!

Aleph one allows for each surface to be painted with a light index (see 0-25 above), and before I had them applied to surfaces, I rendered them to HTML elements below my canvas. 0-20 are predefined 5% increments, but above that there are pulsing lights, strobes, and flickering lights.

Pfhreak fucked around with this message at 16:59 on May 4, 2012

Sym
Feb 22, 2006
Where am I?

Pfhreak posted:

Edit: If someone has any tool suggestions for screen recording only a portion of my desktop, I'd be thrilled to hear them.

http://camstudio.org/ might work

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I know this is old news for most desktop environments, but here's something that's a bit hard to do under X/Linux: transparent window decorations.



It's also driven by CSS:

code:
MetaWindow {
    border-radius: 10px 10px 0 0;
    background-color: rgba(255, 0, 0, 0.6);
    background-clip: border-box;
    border: 4px solid black;
    padding-top: 20px;
    color: white;
    text-shadow: 1px 1px black;
}

MetaWindow:backdrop {
    background-color: green;
}
I can sperg all about why this is hard for all sorts of reasons if you want me to, and the code that I have isn't entirely right.

Opinion Haver
Apr 9, 2007

Pfhreak posted:

It's been a while since I posted my progress on this, but here's the latest screenshot:



You'll see I now can render the level geometry, texture it, and apply lighting to it. Getting the lights to behave just like they did in the original engine took a little bit of doing, so I went ahead and recorded a (crappy low quality) video of them in action:

http://www.youtube.com/watch?v=i8Me6KZQ-iw New higher quality video!

Aleph one allows for each surface to be painted with a light index (see 0-25 above), and before I had them applied to surfaces, I rendered them to HTML elements below my canvas. 0-20 are predefined 5% increments, but above that there are pulsing lights, strobes, and flickering lights.

Jesus, this is really impressive.

Cancelbot
Nov 22, 2006

Canceling spam since 1928

I've been working on a meal planner app for android:

You add ingredients


Create a meal with them and then it plans your week using the power of random number generators!


(Not done: Generating a shopping list and using perishable ingredient markers to suggest the correct "best before" dates to look for)

steckles
Jan 14, 2006

Manslaughter posted:

Whipped up in GM but you get the general idea:

Sweet, thanks!

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice
Someone in the CC subforum here posted this:


So I spent this weekend writing it in Ruby with Chingu:


I obviously have a little left to do (loving rivers ugh) but it's been fun. It reads the world from a txt file filled with heights. Also, isometric stuff is not fun at all.

A Sober Irishman
Sep 13, 2007

"He killed 16 Czechoslovakians. Guy was an interior decorator."

"Really? His house looked like shit."
Trying not to be a total failure at PHP & mySQL, so I'm making a simple todo app to expand my skills. Also as an excuse to use Twitter Bootstrap, which is pretty rad. I develop in VB.NET and ASP.NET in my day job, and using PHP is a lot harder because it basically doesn't tell you squat and you have to set up a lot yourself.

As for the app, you can add tasks, and each task can have #hashtags as well which will appear within the task. I need to make a sort by tag page still. You can mark tasks as complete and delete them, as well as view completed tasks and "uncomplete" completed tasks.

Here is a live example on EC2:

http://ec2-23-23-212-251.compute-1.amazonaws.com/index.php

The Github repo. Please be kind on my PHP, which is probably full of flaws/worst practices that I don't know about :

https://github.com/Martin-Brennan/todo

And some screens in case the site goes down:


Delta-Wye
Sep 29, 2005

A Sober Irishman posted:

Trying not to be a total failure at PHP & mySQL, so I'm making a simple todo app to expand my skills. Also as an excuse to use Twitter Bootstrap, which is pretty rad. I develop in VB.NET and ASP.NET in my day job, and using PHP is a lot harder because it basically doesn't tell you squat and you have to set up a lot yourself.

As for the app, you can add tasks, and each task can have #hashtags as well which will appear within the task. I need to make a sort by tag page still. You can mark tasks as complete and delete them, as well as view completed tasks and "uncomplete" completed tasks.

Here is a live example on EC2:

http://ec2-23-23-212-251.compute-1.amazonaws.com/index.php

The Github repo. Please be kind on my PHP, which is probably full of flaws/worst practices that I don't know about :

https://github.com/Martin-Brennan/todo

And some screens in case the site goes down:




I was bored at work so I attempted some half-hearted injection attacks (I'm helping! I'm helping!)

The code fails to add tasks with single quotes in the name. Probably a protection measure, but not sure if you would consider that an issue with usability (what if I wanted a task with a single quote in it?) I noticed I could just look at the source code though which kind of takes all the fun out of the injection stuff so I gave up. Did notice this though:
$mysqli = new mysqli('localhost', 'mjrbrennan', 'develop', 'todo');

Not going to try, but I hope that user doesn't exist for other hosts :wink:

jarito
Aug 26, 2003

Biscuit Hider

A Sober Irishman posted:

I develop in VB.NET and ASP.NET in my day job, and using PHP is a lot harder because it basically doesn't tell you squat and you have to set up a lot yourself.

I'm not a big PHP guy, but it seems that people that are doing real PHP development are using a framework like CakePHP.

http://cakephp.org/


Should be more like you are used to with the WebForms / MVC stacks.

SlightlyMadman
Jan 14, 2005

jarito posted:

I'm not a big PHP guy, but it seems that people that are doing real PHP development are using a framework like CakePHP.

http://cakephp.org/


Should be more like you are used to with the WebForms / MVC stacks.

CakePHP is pretty awful, although mostly because it's written in PHP. PHP is fine for quick & dirty scripts that won't ever have to scale, but it shouldn't be used for real development. If you want MVC, ASP.NET has a great implementation (MVC3). Django is my favorite, but it's not everyone's cup of tea.

edit: To clarify, I'm not saying people shouldn't learn PHP. It's all over the place so a bit of experience will come in handy. I just think CakePHP is a silly idea, because it's specifically made for types of projects where PHP is one of the worst languages you could possibly choose.

If you find yourself doing "real PHP development" then you've likely made a wrong turn somewhere.

SlightlyMadman fucked around with this message at 20:13 on May 7, 2012

A Sober Irishman
Sep 13, 2007

"He killed 16 Czechoslovakians. Guy was an interior decorator."

"Really? His house looked like shit."

Delta-Wye posted:

I was bored at work so I attempted some half-hearted injection attacks (I'm helping! I'm helping!)

The code fails to add tasks with single quotes in the name. Probably a protection measure, but not sure if you would consider that an issue with usability (what if I wanted a task with a single quote in it?) I noticed I could just look at the source code though which kind of takes all the fun out of the injection stuff so I gave up. Did notice this though:
$mysqli = new mysqli('localhost', 'mjrbrennan', 'develop', 'todo');

Not going to try, but I hope that user doesn't exist for other hosts :wink:

It's all good, that user doesn't exist anywhere else, only on my localhost. Where do you put stuff like that for PHP so no one can access it? In ASP.NET you just have it in the Web.Config file, which seems a lot more secure.

As for the single quotes thing, I didn't even realize that and I haven't been trying to remove them. Too used to ASP.NET I guess, so I haven't been doing string sanitising, so I'll have to look that up.

Thanks for the framework advice jarito & Slightly Madman, I wanted to at least figure out how to use PHP outside a framework first, otherwise I think I'd just get confused.

SlightlyMadman
Jan 14, 2005

For php apps, I generally mimic the notion of web.config files. I'll make a file called site_config.php.default with a bunch of bogus variable assignments in it, then keep a site_config.php.dev, site_config.php.prod, etc. For a public repository, only the default file should be committed. I then rename the appropriate one to site_config.php for then environment, but never commit it.

Inverse Icarus
Dec 4, 2003

I run SyncRPG, and produce original, digital content for the Pathfinder RPG, designed from the ground up to be played online.

poemdexter posted:

Someone in the CC subforum here posted this:


So I spent this weekend writing it in Ruby with Chingu:


I obviously have a little left to do (loving rivers ugh) but it's been fun. It reads the world from a txt file filled with heights. Also, isometric stuff is not fun at all.

I've done stuff like this a lot. I really like tile maps with heights.

It seems that every few years I get this nagging drive to start working on a game again, and it always ends a few days later with me remembering why I stopped the last time.

Here's a screenshot of the last time I tried my hand at it:



This is built from an unoptimized xml file that looks like this:

pre:
...
<row>
<tile type="stone" height="8"/>
<tile type="stone" height="4"/>
<tile type="stone" height="4"/>
<tile type="stone" height="5"/>
<tile type="stone" height="5"/>
<tile type="stone" height="4"/>
<tile type="grass" height="0"/>
<tile type="stone" height="10"/>
</row>
<row>
<tile type="stone" height="10"/>
<tile type="stone" height="4"/>
<tile type="stone" height="5"/>
<tile type="stone" height="4"/>
<tile type="stone" height="4"/>
<tile type="grass" height="0"/>
<tile type="grass" height="0"/>
<tile type="stone" height="10"/>
</row>
...
Are you planning to make a game, or is it more of a for-fun prototype?

Inverse Icarus fucked around with this message at 22:52 on May 7, 2012

Azazel
Jun 6, 2001
I bitch slap for a living - you want some?

jarito posted:

I'm not a big PHP guy, but it seems that people that are doing real PHP development are using a framework like CakePHP.

http://cakephp.org/


Should be more like you are used to with the WebForms / MVC stacks.

Ugh. While your intentions might be true, I'll echo other sentiments and point out that this is a horrible framework. If you just want to bang out a small 10 user app in a half day then it'll be fine, but if you care anything about performance stay the gently caress away from it. If you absolutely have to use a PHP framework (vs. another language or no framework) and performance is critical I'd actually suggest the Yii framework, which is decent to work with and one of the most performant PHP frameworks out there.

Keep in mind I absolute loathe PHP, and think it's a horrible pieced together hack of a language. The only reason I am throwing this information around is because over here in Japan every web/social game company that exists uses the standard LAMP stack "because Yahoo does", and I have yet to meet any company in this realm that uses a web language outside of PHP or Perl.

Put CakePHP at the bottom of your potential PHP framework lists, and do everyone else a favor and tell them the same.

Edit: I should add that it was "suggested" to me on one of the social games I was lead on that we use CakePHP. I wasted so much time trying to make that stupid framework performant it drives me into a blind rage. You can always scale your servers out, but to achieve the same benchmarks as raw PHP you need roughly 2-4'x more servers in your cluster. It's ridiculous.

Azazel fucked around with this message at 02:02 on May 8, 2012

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

Inverse Icarus posted:

I've done stuff like this a lot. I really like tile maps with heights.

It seems that every few years I get this nagging drive to start working on a game again, and it always ends a few days later with me remembering why I stopped the last time.

Here's a screenshot of the last time I tried my hand at it:



This is built from an unoptimized xml file that looks like this:

pre:
...
<row>
<tile type="stone" height="8"/>
<tile type="stone" height="4"/>
<tile type="stone" height="4"/>
<tile type="stone" height="5"/>
<tile type="stone" height="5"/>
<tile type="stone" height="4"/>
<tile type="grass" height="0"/>
<tile type="stone" height="10"/>
</row>
<row>
<tile type="stone" height="10"/>
<tile type="stone" height="4"/>
<tile type="stone" height="5"/>
<tile type="stone" height="4"/>
<tile type="stone" height="4"/>
<tile type="grass" height="0"/>
<tile type="grass" height="0"/>
<tile type="stone" height="10"/>
</row>
...
Are you planning to make a game, or is it more of a for-fun prototype?

It was a for-fun prototype just because I saw it and said "hey, i could probably program that!" Isometric can suck a dick and I don't even like how I had to draw everything front to back and from bottom to top height wise. The map is reading from a txt file but adding a single row throws off the entire thing since the alternating tiles go stupid. If anyone wants to poke around: https://github.com/poemdexter/Landscape

Deus Rex
Mar 5, 2005

Azazel posted:

Keep in mind I absolute loathe PHP, and think it's a horrible pieced together hack of a language. The only reason I am throwing this information around is because over here in Japan every web/social game company that exists uses the standard LAMP stack "because Yahoo does", and I have yet to meet any company in this realm that uses a web language outside of PHP or Perl.

wait… are you saying in Japan nobody uses Ruby for web programming? :aaa:

Azazel
Jun 6, 2001
I bitch slap for a living - you want some?

Deus Rex posted:

wait… are you saying in Japan nobody uses Ruby for web programming? :aaa:

As far as I am aware. Surely there's edge cases, I've met my Japanese clone and he's a Ruby fanatic himself. But every place I've worked at or visited was very resistant to using anything but PHP. I did write a small smartphone score API in Ruby, but then the company buckled before the system went live :suicide:

wlievens
Nov 26, 2006

poemdexter posted:

It was a for-fun prototype just because I saw it and said "hey, i could probably program that!" Isometric can suck a dick and I don't even like how I had to draw everything front to back and from bottom to top height wise. The map is reading from a txt file but adding a single row throws off the entire thing since the alternating tiles go stupid. If anyone wants to poke around: https://github.com/poemdexter/Landscape

Isometric rendering is FUN imho.

Xerol
Jan 13, 2007


I did a nearly-isometric OpenGL perspective view once that was basically isometric for all intents and purposes (it involved a really faraway camera and a really narrow FOV) which just let you use normal 3d models for everything, so you could rotate the view without having to make all the graphics four times, and zooming worked too (although I don't remember how I did that). It also made picking with the mouse really easy since everything was nearly pixel-perfect.

https://www.youtube.com/watch?v=2WSDzl7TC44

akadajet
Sep 14, 2003

Roflex posted:

it involved a really faraway camera and a really narrow FOV

You could just use an orthographic projection, unless you're going for an "almost orthographic" effect like you see in Blizzard games.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

wlievens posted:

Isometric rendering is FUN imho.

Give a decent solution for the following:

I have a text file with:
code:
123123
456456
789789
123123
When I translate that to drawing, I get tiles in this form:
code:
1 2 3 1 2 3
 4 5 6 4 5 6
7 8 9 7 8 9
 1 2 3 1 2 3
So for the first 5, to move "up" would be to hit the 2 which when drawn looks like it's northwest. If I was at the 8 looking to move "up", I would hit the 5 which is northeast! So now when I'm trying to decide while sprite I need due to the black bold lines being necessary and having around 20 different sprites, I have to know which row I'm on so I know how to look in the 2d array to get the correct surrounding pieces.

Xerol
Jan 13, 2007


akadajet posted:

You could just use an orthographic projection, unless you're going for an "almost orthographic" effect like you see in Blizzard games.

Would that let you freely position the camera, though?

penus de milo
Mar 9, 2002

CHAR CHAR

kaempfer0080 posted:

I made a remake of Yar's Revenge for the Atari in Java for a class. I named it Char's Revenge.

I demand royalties.

seiken
Feb 7, 2005

hah ha ha

poemdexter posted:

Give a decent solution for the following:

Translating to drawing you should get this
code:
1 2 3 1 2 3
 4 5 6 4 5 6
  7 8 9 7 8 9
   1 2 3 1 2 3
Or equivalently your textfile for that drawing should look like this
code:
 123123
 456456
789789
123123
You shouldn't use such a weird coordinate system just because that's how it appears on-screen, probably.

Edit: wait, I'm not visualizing correctly, probably this would be better still because then both axes are actually movement axes:
code:
 1
742
1853
 2961
  3742
   1853
    296
     3
becomes
code:
1 2 3 1 2 3
 4 5 6 4 5 6
7 8 9 7 8 9
 1 2 3 1 2 3
And
code:
123123
456456
789789
123123
becomes
code:
     3
    2 6
   1 5 9
  3 4 8 3
 2 6 7 2
1 5 9 1
 4 8 3
  7 2
   1
And you can draw back-to-front by doing diagonal lines starting from one (top-right, here) corner. In fact if you use the opposite rotation you draw back-to-front by doing diagonal lines from the top-left corner so maybe that's best of all.

seiken fucked around with this message at 16:34 on May 8, 2012

Jo
Jan 24, 2005

:allears:
Soiled Meat
Why not just use the OpenGL orthographic camera? A perspective camera at optical infinity is practically the same thing, but you need to mess with floating point imprecision.

seiken
Feb 7, 2005

hah ha ha
Well if you want to draw it that way that's fine, you still gotta store the map data in a sensible structure which is mostly what I was covering in my post.
Edit: nevermind, sorry, I thought you were talking to me but it's clear you're talking to Roflex.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

seiken posted:

Translating to drawing you should get this
code:
1 2 3 1 2 3
 4 5 6 4 5 6
  7 8 9 7 8 9
   1 2 3 1 2 3
Or equivalently your textfile for that drawing should look like this
code:
 123123
 456456
789789
123123
You shouldn't use such a weird coordinate system just because that's how it appears on-screen, probably.

Edit: wait, I'm not visualizing correctly, probably this would be better still because then both axes are actually movement axes:
code:
 1
742
1853
 2961
  3742
   1853
    296
     3
becomes
code:
1 2 3 1 2 3
 4 5 6 4 5 6
7 8 9 7 8 9
 1 2 3 1 2 3
And
code:
123123
456456
789789
123123
becomes
code:
     3
    2 6
   1 5 9
  3 4 8 3
 2 6 7 2
1 5 9 1
 4 8 3
  7 2
   1
And you can draw back-to-front by doing diagonal lines starting from one (top-right, here) corner. In fact if you use the opposite rotation you draw back-to-front by doing diagonal lines from the top-left corner so maybe that's best of all.

I don't think I'm getting any of that. Seems like I'll end up with a diamond composed of smaller diamond sprites when I really want a boxish area filled with diamond sprite like the screenshot I linked earlier.

Xerol
Jan 13, 2007


Jo posted:

Why not just use the OpenGL orthographic camera? A perspective camera at optical infinity is practically the same thing, but you need to mess with floating point imprecision.

Maybe I'm misunderstanding the Ortho view but the way I did it, it's still 3d/perspective at the core, allowing free view from any angle.

Adbot
ADBOT LOVES YOU

seiken
Feb 7, 2005

hah ha ha

poemdexter posted:

I don't think I'm getting any of that. Seems like I'll end up with a diamond composed of smaller diamond sprites when I really want a boxish area filled with diamond sprite like the screenshot I linked earlier.

You see how the isometric grid is really just a grid of squares, right? Like if you imagine rotating everything a bit you just get a regular grid of squares? Well that's how you should store it, if you just pretend it's a grid of squares in memory and only "rotate it" when it comes to displaying it, then it's trivial to find which tiles connect to where in memory, like you asked for. There's no reason to store the tiles in memory/file in the same layout as they appear on screen, because that's not actually the topology going on.

And the shape of the overall "map" doesn't matter since obviously you can store any shape? Like I said, if in memory/in your file format it looks like THIS
code:
 1
742
1853
 2961
  3742
   1853
    296
     3
then every tile's neighbours are always directly adjacent vertically or horizontally, with consistent direction, but you can "rotate" it for display to get this
code:
1 2 3 1 2 3
 4 5 6 4 5 6
7 8 9 7 8 9
 1 2 3 1 2 3
which is a box shape full of diamonds like you want.

For the record, the same principle applies to hex grids since a hexagon grid is exactly the same as a square grid on which you are allowed to move horizontally, vertically, and in one pair of opposite diagonal directions but not the other.

seiken fucked around with this message at 18:37 on May 8, 2012

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply