• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Guest Anonymous Poster

I need some help!

3 posts in this topic

Mouse Maps are really easy to use, but
if you have a tile with a set ratio,
such as 2:1, then you can create a simple
function that'll figure the coordinates
for you. I don't know if this is something
you were talking about.

Check out my page under the files section
for the article I wrote a while ago: http://www.lightbefallen.com

Jim Adams

------------------
Jim Adams
Co-Designer 'The Light Befallen'
tcm@pobox.com
http://www.lightbefallen.com

0

Share this post


Link to post
Share on other sites
below is the portion of a recent iso demo that i made that deals with mapping mouse coordinates to tile positions. it uses a diagonal map (aka diamond shaped, the type used in SimCity2k, AoE, etc.)


case WM_MOUSEMOVE:
{
//get mouse coordinates
int xPos = LOWORD(lparam); // horizontal position of cursor
int yPos = HIWORD(lparam); // vertical position of cursor
int fwKeys = wparam; // key flags

//adjust xpos to reference off of tile 0,0
xPos-=(MAPROWS*TILEWIDTH/2-TILEWIDTH/2);

//calc mousemap row and column
int MMCol=xPos/TILEWIDTH;
int MMRow=yPos/TILEHEIGHT;

//calc mm row and col remainders
int MMColR=xPos%TILEWIDTH;
int MMRowR=yPos%TILEHEIGHT;

//adjust MM coordinates if a remainder is negative
if(MMColR<0)
{
MMColR+=TILEWIDTH;
MMCol--;
}
if(MMRowR<0)
{
MMRowR+=TILEHEIGHT;
MMRow--;
}

//calc cursor position
ptCursor.x=MMCol+MMRow;
ptCursor.y=MMRow-MMCol;

//find color in mousemap
COLORREF crTest=GetPixel(hdcTile[TILE_MOUSEMAP],MMColR,MMRowR);

switch(crTest)
{
case MM_NE://northeast
{
ptCursor.y--;
}break;
case MM_SE://southeast
{
ptCursor.x++;
}break;
case MM_NW://northwest
{
ptCursor.x--;
}break;
case MM_SW://southwest
{
ptCursor.y++;
}break;
case MM_CE://center
{
}break;
}

//make certain that cursor is in bounds
if(ptCursor.x<0) ptCursor.x=0;
if(ptCursor.x>=MAPCOLS) ptCursor.x=MAPCOLS-1;
if(ptCursor.y<0) ptCursor.y=0;
if(ptCursor.y>=MAPROWS) ptCursor.y=MAPROWS-1;

//force a repaint
InvalidateRect(main_window_handle,NULL,FALSE);

if(fwKeys&MK_LBUTTON)
{
TileMap[ptCursor.x][ptCursor.y]=1;
DrawMap();
}
if(fwKeys&MK_RBUTTON)
{
TileMap[ptCursor.x][ptCursor.y]=0;
DrawMap();
}

return(0);
}break;

in this code example, the map uses tile coordinates where tile (0,0) is the topmost tile of the map. x increases to the southeast, and y increases to the southwest.

this example also has the client area of the window the same size as the complete area of the tilemap, so there is no screen coordinate to world coordinate transformation, and in most cases, there would be.

so anyway, the example goes through the following steps:

1. Translate world coordinates to make (0,0) reference the upperleft corner of Tile(0,0)

to do this, we subtract (MAPROWS-1)*TILEWIDTH/2, because this sum is added when we transform tile coordinates into world coordinates

2. Determine MouseMap Column, Row, and Column and Row remainders.

MMC=x/TILEWIDTH;//columns
MMR=y/TILEHEIGHT;//row
MMCR=x%TILEWIDTH;//col remainder
MMRR=y%TILEHEIGHT;//row remainder

2A. Fix any negative remainders

due to the way integer division works, we have to make sure that the remainder is a positive value, where 0<=MMCRso:

if(MMCR<0)
{
MMCR+=TILEWIDTH;
MMC++;
}
if(MMRR<0)
{
MMRR+=TILEHEIGHT;
MMR++;
}

3. calculate rough tile coordinates based on MMC and MMR

//clear the coordinates out
TileX=0;
TileY=0;

now, for each mousemap column to the east, add 1 to x and subtract 1 from y, to the west, subtract 1 from x and add 1 to y

for each mousemaprow to the north, subtract 1 from x and subtract 1 from y, to the south, add 1 to each of x and y

so,

TileX=MMC+MMR;
TileY=MMR-MMC;

4. we tweak this rough tile position to get the actual tile position, using the mousemap

since i store the mousemap as a bitmap on a system memory DC, we get the pixels color at (MMCR,MMRR)

COLORREF crTest=GetPixel(hdcMouseMap,MMCR,MMRR);

next, adjust the TileX, TileY based on the value of crTest.

i made a few constants to specify certain colors found on the mousemap, to make lookup easier.

MM_NW: TileX--;
MM_NE: TileY--;
MM_SE: TileX++;
MM_SW: TileY++;
MM_CE: no adjustment

so, thats the method i use.

for fixed ratio tiles, as mine are(64x32), an alternate way is to use Jim's method, which is optimized for tiles with a ratio of 2:1.

if you want to get my isometric example program (the one i mention in this post is Isometric Example #5), the source code and workspace for VC++6, just email me for the time being. soon, these examples, workspaces, and articles about them will be published here on gamedev, so stay tuned.

0

Share this post


Link to post
Share on other sites
Hey,
Does anybody know how to draw isometric slope tiles used in games like SimCity2000, SimCity3000, and RollerCoaster Tycoon. The slope tiles are the tiles that are sloped upward or downward to produce mountains or hills. Was there a special method used to
draw these???? In newer games like SimCity3000 there are like 30 types of slopes tiles, at all these different angles, what method was used to draw these???


My second question is to TANSTAAFL, I've read your isometric tutorials, and they really helped me to start an isometric engine. Thank you! There is only one problem I'm having right now which is the mouse. I read your tutorials on mousemaps(at the bottom of the isometric tutorials), I understood how this would work with staggered maps, but not with diagonal maps. In one of the tutorials you wrote about how to do the mousemaps with diagonal isometric maps, but I couldn't understand it. If could you please show me how to use mousemaps with diagonal isometric maps with more detail, I would really really appreciated it!

Thanks alot,
Later
Da_KiD

0

Share this post


Link to post
Share on other sites
Thanks Jim & TANSTAAFL!

TANSTAAFL could you please email me the source for that mousemap example at

email - datisme@notme.com

Jim, I saw your game, and you used slope tiles, like in Simcity2000, how did you draw these type of tiles???

Thanks for your help,
Da_KiD

email - datisme@notme.com

0

Share this post


Link to post
Share on other sites