• 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.
Sign in to follow this  
Followers 0
miradosamurai

Need Help With rogue-like problem

9 posts in this topic

hey guys i am working on a rogue like game and i have quickly hit a problem ,which is i don't know how to make a wall in the game that the player can't walk through i have got boundaries set up but that's it and if you didn't notice the tag im coding in C#.by the way if your thinking i should know this code like the back of my hand im mainly working on this as a learning thing so please don't be rude.

 

actually its not going to be turn based the enemies/npcs are going to move whether you do or not. and like i said i am doing this to learn so i don't know how to do that paradigm.

Edited by miradosamurai
0

Share this post


Link to post
Share on other sites

Tile based, moving 1 square at a time, like Rogue or Nethack? That's easy, store the player position before a move, move the player to the new tile, if it is blocked remember what the player hit (walking into a wall may print ouch, moving into a monster may attack, etc.), and move the player back to the old position.

 

It may be easier to code if you have dummy tiles surrounding the map which are always blocked so you don't need special cases for preventing the player from moving off the edge of the map.

Edited by Paradigm Shifter
1

Share this post


Link to post
Share on other sites

like i said i am doing this to learn and i don't know how to do that and no its not going to be 1 square at a time.

-3

Share this post


Link to post
Share on other sites

like i said i am doing this to learn and i don't know how to do that and no its not going to be 1 square at a time.

you can use a 2-d array given miradosamurai's advice.

0

Share this post


Link to post
Share on other sites

like i said i am doing this to learn and i don't know how to do that and no its not going to be 1 square at a time.

 

I don't understand what you mean. Paradigm Shifter's post tells you how to do "that", and it does everything your initial post suggests you need. If it is inadequate for what you're trying to achieve, please explain how so (if movement isn't one square at a time, how does it work?). If you don't understand something that is posted, ask for more information. Is there a specific piece of Shifter's post you don't understand?

 

Posting more information about what you've already got will be helpful also. What constitutes a "player", "enemy", "wall", or "boundary" in your code as you've currently designed it?

 

by the way if your thinking i should know this code like the back of my hand im mainly working on this as a learning thing so please don't be rude.

 

Try to avoid being rude yourself. Even if you don't mean to sound harsh or ungrateful, a poorly chosen word or phrase that sounds like you are can dramatically reduce the number of replies you get. Bear in mind that you're asking people to help you, for free, and in their spare time. I've always found people here extremely helpful, regardless of the question asked, as long as it is asked nicely and with a bit of humility.

1

Share this post


Link to post
Share on other sites

sorry i wasn't meaning to be rude, also i miss read Paradigm Shifters reply and i though he meant turn based; also like i said i am doing this as a learning experience so i am a noob or whatever you want to call me , i do not understand c# 100% and i do not know how to do most of the things on this website. 

0

Share this post


Link to post
Share on other sites

Shifter's post is language-agnostic. It suggests a couple of data structures and functions but leaves implementation abstract.

 

What Shifter described is basically this:

 

Say you have a map which is represented as a 2D array, as in warnexus's post. Anything on the map (a character, monster, wall, whatever) has a current position represented as a point on that map. So the player character might be at position (5, 6), where 5 is the x coordinate and 6 the y. If the player wants to move up one space (coordinate point (5, 7)) your game would update the player's position accordingly.

 

But if there's a wall at (5, 7) you won't want the player to be able to move there. So in the function you're using to move the player character you would first check to see if moving from (5, 6) to (5, 7) is valid. If it is, meaning that the space is open and the player can move there, then you would allow the function to update the player's location to (5, 7). If it's not valid, meaning that (5, 7) is blocked for whatever reason, then the function will not allow the player's location to (5, 7) but rather will remain (5, 6).

 

How exactly this will be implemented in your code depends on how you've designed it, which we can't know unless you give us some more information. How you're handling time (turn-based, real-time, whatever) doesn't really matter; you would perform the check as often as is necessary, whether that's by turn, per tick, per second, per hour, per movement attempt.

 

Unless and until you give us more information on what code you've already written or how you've designed things so far no one will be able to give you much more than general advice. I can't tell you how to implement this in C#, not because neither of us knows C# well enough but because there's no one "C#" way to do it. The language is about rules for how code is written, it doesn't enforce many design constraints on you. Language makes zero difference at all in designing these features into your game. So again, I'll request that you present some code to us, or some design decisions you've made, or ask some more specific questions, or ask for more specific clarifications.

0

Share this post


Link to post
Share on other sites

I took a brief look at the video you linked to. Is this tutorial the only exposure you have to programming, in C# or otherwise?

 

How well can you explain your code which, as you said is mostly a copy of the tutorial's? Can you describe the flow of the program as it executes, how the functions work, how data related to gameplay concepts (such as player location) is represented, or might be represented in the future, in the code?

 

It's not bad to use tutorials when learning how to program new types of projects, but no number of tutorials can substitute for learning a programming language or gaining experience in program design. "How to program X type of game" is my least favorite type of programming tutorial. Most of the time they aren't even wrong, but they tend to produce bad programming habits (particularly related to design and debugging) and hollow coders who may have a game to show but not much independent programming ability. I'm not saying that that describes you, just that tutorials like this one should not be a major piece of your programming education. Particularly if you're just starting out.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0