• 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
Sunsharior

Advice about "Camera Zone".

4 posts in this topic

Hello.

 

In this game engine i am working on, i have a camera problem that i will explain in a moment.

Before i continue thought, i must state that i aleredy have a few idea on how to resolve it, but i feel all of them are "awkward". So i come here to hear about yours opinions.

 

The problem is kind of hard to explain, i will try my best to be as precise as possible.

 

I have a 2D sidescroller game. In this game is a Camera Class that can move around dynamically, that means it will try it best to keep up with whatever it's bound to.

The camera follow a simple rules: Don't go out of the Level. This mean in a 100x100 Map, the camera won't go left of tile 0 or right of tile 100.

 

With this come 2 major problem

1. If i wants to make a "secret" area where i do not wants the camera to enter before the player do.

2. If i wants to stop the camera right at the floor level, even if the level go below the floor eventually.

 

if i am not clear enought, i have attached an image to show the problem.

 

In picture one, you can see the level Editor. I made a corridor leading to a pit. Picture 2 is zoomed it with the player spawned. You can see in picture 2 the problem. I wants the camera to stop at the floor and not go under the floor until the actor is nearby the pit.

 

So i got somes idea on how to solve it, but like i said earlier, neither are spectacular.

1. Flag somes tiles as "Don't go in here yet". If the camera is about to show them, stop the movement.

2. In the map header, tell the camera where it can go and where it can't go.

3. Disallow the camera to enter "empty space" or tile flagged as "secret space" (a trigger would unflag such area as soon as the player touch it).

4. Put trigger everywhere in the level to tell how the camera should behave.

 

Personnaly i would go with option 3 but i wants to hear what everyone is thinking. Maybe there is a better solution i am not thinking of.

 

Ps: Graphics are just placeholder.

1

Share this post


Link to post
Share on other sites

You can try covering your secret area with "secret area tiles" that looks the same as its surroundings. When the player walks into these tiles, they fade / disappear. That way your camera can show the secret area without letting the player know that it's a secret area. Think of the illusion walls in Dark Souls or the breakable walls in Castlevania.

0

Share this post


Link to post
Share on other sites
Whenever the player moves, check if the camera needs to move. Clip the motion of the camera against any "void zones." If the player gets very close to an edge of the camera viewport then don't clip the camera against any "soft void zones" in that direction. If the player passes an edge of the camera viewport then don't clip against any "void zone" in that direction.

This means that if a player falls a long way down, the camera works as normal, following the player and keeping it roughly in the middle of the screen (depending on how much "slop" you want when the camera follows the player). When landing on the ground (with a "void zone" below), the camera will now cease to move down and the player will no longer be in the center of the screen. If the player then drops down through the floor somehow, as the player gets near the edge of the screen the camera will begin following the player again.

Depending on level design the margin of the camera viewport which triggers the "void zone" cancellation may need to be particularly small (possibly even less than the size of the player itself).

You could do this with a force-like system as well where each "void zone" exerts a force pushing the camera away from it if close and the player has a spring-like force to try to keep the camera centered on it. Once the spring-like force of the player surpasses the force of any intersecting void zones, disable the void zone entirely until it is no longer intersecting. Another nice effect of using a spring-like force on the player is that the camera will accelerate towards the player and then slow down as it approaches.

This force-based approach can be a nice effect for some games when you have the camera and player disjoint for a moment, like say after the player teleports. If the camera can rescale to keep multiple focal-points within the viewport this can also provide a smooth effect when an item toggles being of interest or not; for instance, if you spawn into a level and want the goal to be visible momentarily you could toggle it on as a point of interest (and the camera "physics" would accelerate to encompass both player and goal and anything in between) and then turn that off after a few seconds (so the camera returns to its normal proportions). Downsides of this approach are that the camera may feel laggy or spongy if it's not tuned just right and it may still end up being inappropriate for certain kinds of games.
0

Share this post


Link to post
Share on other sites

Thanks! I had aleredy implemented the spring-like feature you wrote about. With what you said in mind, i'll just tweak it to stop before clipping with a void, but if the player goes out of focus, the camera will ignore the void flag.

 

I like this as i don't need to tweak too much.

0

Share this post


Link to post
Share on other sites
Another solution is implementing a camera rail: a collection of connected splines that describe the points that the camera can move to.
You will need to program a simple solver algorithm that computes the best camera position on the splines so that the camera best focuses the player.

This way you can build the splines in a way that the camera never reveals certain parts of the level because it can't go there.
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