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

fastcall22

Moderators
  • Content count

    2485
  • Joined

  • Last visited

Community Reputation

10833 Excellent

About fastcall22

  • Rank
    Web Developer

Personal Information

  • Location
    Nowhere Important
  • Interests
    Programming

Recent Profile Visitors

25660 profile views
  1. HTML5

    There are some non–obvious problems with this setup, but let’s cover some CSS basics first. Every HTML element has a set of properties that describe how it should be laid out on a page and how it should rendered. They can be accessed with it’s style property in Javascript. You can write Javascript or add a style attribute to each HTML element to give your page the look and feel, but it quickly becomes tedious and cumbersome. Enter CSS. It allows you to apply styles to elements determined by rules. These rules can even be stored in a separate file, so you don’t have to clutter your HTML. Here’s a CSS cheatsheet. Now, on to style matching. If you want to match styles, then open your browser’s developer tools and inspect random elements on the page. Poke at their CSS properties and find out what they’re made of. Take note of font-family, font-size, line-height, color, background, padding, and margin properties as they are a significant chunk of the look and feel. -- Next, let’s talk about RSS. When querying an RSS feed, you are met with an XML document with a summary of recent posts. Here’s an example RSS feed. The problem is that this XML isn’t usable HTML. It will need to be transformed into HTML. You’ve opted to use rssdog.com do this for you. The query string parameters you pass to rssdog tells it which RSS feed to fetch and how to render that HTML, along with some basic styling. By using an iframe tag with this URL, the user’s browser will make a separate request on your homepage to rssdog with your parameters and rssdog will fill that space with the resulting HTML. Browsers are particular about cross–domain interactions for good reason, so while this iframe is a part of your homepage, it is a considered a separate web page and has protections against modification. More on this later. -- So, options at this point: Render the XML yourself, server side. This is the easiest option as you can embed the resulting HTML directly into your page and you can retain your styling. You will need to research what server side languages are available with your web hosting provider. You will then need insert a server side script on your homepage that will download the XML from the RSS feed (using CURL, for example), traverse the resulting XML document, and render the HTML. Render the XML yourself, client side. Include some Javascript to invoke an XHR request to your feed, receiving the XML, and dynamically creating HTML elements from it. This requires that the server send a Access-Control-Allow-Origin header to grant access from shogun3d.net to blog.shogun3d.net. Check your web hosting provider on how to send that header. After enabling the option, use the network tab on your developer tools to ensure that the header was sent. (Be sure to hard refresh to prevent your browser using a cached version of the page and headers.) The theme you have selected has jQuery included, so you can use jQuery.ajax to fetch your XML. Otherwise, you can use a raw XMLHttpRequest. Manually sync your homepage with your blog. This is the most annoying option.
  2. Since the items are referred to by their tag, then it would be easier to use an associative array, such as `dict` or `collections.OrderedDict`. Then, checking if the inventory is full is only a matter of checking the number of tags it has: items = dict() def is_full(self): return len(self.items) >= 8 You are correct in that it is misleading to add an item and not actually have an item added. This is why it is important to signal if an action succeeded and (optionally) provide other ways to determine if an action will succeed. For example: class Inventory: max_inventory_size = 8 def __init__(self): self.items = dict() @property def full(self): return len(self.items) >= self.max_inventory_size def can_accept(self, item): return item.tag in self.items or not self.full def try_add_item(self, item): if not self.can_accept(item): return False self.add_item(item) return True def add_item(self, item): target = self.items.get(item.tag, None) if target is not None: target.quantity += item.quantity else: assert not self.full, "Inventory full" self.items[item.tag] = item # and then: (1) # expect this action to succeed, otherwise crash hard inv.add_item(item) # or: (2) # lazily attempt action, not caring if it fails if inv.try_add_item(item): world.remove(item) # or: (3) # don’t attempt action, but do check if it is possible for shop_entry in shop_menu: if not inv.can_accept(shop_entry.item): shop_entry.enabled = False
  3. At this very moment, no, but it’s still too early to tell! :^) Programming is an art and can more or less carry over to other languages; don’t worry about choosing the “right language” and just focus on learning the fundamentals with one. Read up on Peter Norvig’s Teach Yourself Programming in Ten Years, and reflect on where you are at now with Java. Good luck!
  4. Of all the blog posts that needs pictures, this needs it the most… !! ᕕ( ᐛ )ᕗ
  5. Gaffer addresses this by clamping the elapsed time per loop to a certain number of updates. There are other ways this can happen as well, such as pausing the game while you’re in the debugger. :^)
  6. That’s more or less the gist of the game loop. I recommend also supplementing your reading with Gaffer’s Fix Your Timestep. It is a similar implementation and may answer your other questions.
  7. bool intersects(const AABB& a, const AABB& b) { AABB test = { min(max(a.min, b.min), b.max), min(max(a.max, b.min), b.max), }; return (test.max - test.min).sq_len() > FLOAT_EPSILON; } Erm, I mean… Post each query to a math forum, using a rendering of the two AABBs on a 3D graph. If the account gets banned for spamming, just keep making new ones.
  8. Looks great!
  9. It was one of Adam Sandler’s better films, but it still wasn’t that great of a movie… ᕕ( ᐛ )ᕗ
  10. Then it must be a typo, consider the following: struct Foobar { int x; void frobnicate() { cout << this->x; } }; int main() { Foobar* f = new Foobar {3}; if ( f = nullptr ) { // Compiler should warn about this line return -1; } f->frobnicate(); // This will always crash delete f; }
  11. Simply interpolate between the old and new positions in the grid and ignore input during the animation. Perhaps something like: void Player::update(float dt) { if ( this->move_state == MoveState::STOPPED ) { int2 dir = this->process_move_input(); if ( dir ) { this->move_state = MoveState::MOVING; this->move_timer = this->move_speed; // in tiles per second this->old_pos = this->pos; this->pos += dir; } } else if ( this->move_state == MoveState::MOVING ) { this->move_timer -= dt; if ( this->move_timer <= 0 ) { this->move_timer = 0; this->move_state = MoveState::STOPPED; } } } void Player::draw() { int2 pos_px; if ( this->move_state == MoveState::MOVING ) { // move_timer goes from 1 to 0, so math on positions is reversed from the traditional A→B interpolation pos_px = this->pos + float2(this->old_pos - this->pos) * (this->move_timer / this->move_speed) * TILE_SIZE_PX; } else { pos_px = this->pos * TILE_SIZE_PX; } // draw avatar at pos_px }
  12. Still getting the hang of where things have moved to, but other than that everything looks and feels great!
  13. Yes, you should process all events in the queue, instead of one per frame: while (!quit) { // if (win.pollEvent(ev)) { while ( win.pollEvent(ev) {
  14. The `EncryptionMode.Decrypt` logic doesn’t initialize the decoding stream with the data provided by the argument. According to MemoryStream(byte[]) it should read something like: ICryptoTransform decryptor = aesm.CreateDecryptor(aesm.Key, aesm.IV); using(MemoryStream ms = new MemoryStream(data)) {
  15. Any* convention is fine as long as you are consistent. *With a few exceptions