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

locoflop

Members
  • Content count

    18
  • Joined

  • Last visited

Community Reputation

135 Neutral

About locoflop

  • Rank
    Member
  1. Hello, in this OpenTK application why can you get the perfect scale with Math.PI? http://www.opentk.com/node/2294   time = (time >= Math.PI) ? 0.0 : time + e.Time; variableScale = (float)(Math.Sin(time)); I know that Sin works best for 0..360 circle degrees range, but Math.PI related to time is strange.   If you have any references about and links to share please post here. Thanks.  
  2. Thanks a lot, this snippet helped me to clarify things a bit. Clever approach to iterate through all of the tilesets.
  3. Here is my favourites (random order): SharpDX: If you want DirectX support currently better for Windows PC, perhaps in the future also for tablets/mobile. There was an ongoing vote to convice Microsoft to enable some functionality that could allow developers to support mobile/tablet devices running Windows 8, but who knows what happened. OpenTK: Very good for cross platform (Windows/Mac/Linux), unfortunately support is halted so you must use the repo of Andy Korth at github in order to get the latest version. Also if you are interested in MonoTouch and MonoDroid chances are that you can reuse most of your code. Pencil.Gaming: An evolution of OpenTK, more clean and practial. It looks like a polished version of OpenTK that is tied to GLFW3 instead for Window management. Unity: You will have to use it to believe. For me personally, let me do other creative things in game rather than system development. It's a matter of where exactly is your interest.
  4. Have any one looked at the Tiled format?   One thing that I try to understand is if a layer contains tiles from two tilesets, then how you can understand which tile originates from a specific tileset.   For example: f tileset A consists of a region of numbers 1 to 19 then it will have first GID 1. If tileset B consists of a region of numbers 20 to 29 then it will have first GID 20. And so on...   If in a Layer I have these tiles: 1, 10, 2, 20, 15, 25 Then they match this pattern of tilesets: A, A, A, B, A, B   What I really don't understand is how you can estimate in programming how this happens. I have looked at various TMX parsers but I can't figure out how exactly they achieve that.
  5. Hello, I have a piece of code where I would like to move the player up and down with touch input. If the touch is made just above the player position then player moves up and the same goes for opposite direction. The problem I have is that when the position of player is the same as the touch position then I have a nasty filckering (player moves up for one moment then moves down, and keep going as long as I have the pressed event going on). I tried to eliminate the flickering but I can't figure out what is going on. Any ideas or a better preffered way will be much welcomed. [CODE] public override void Update(GameTime gameTime) { #region Input NinjaGame.Instance.TouchCollection = TouchPanel.GetState(); foreach (TouchLocation tl in NinjaGame.Instance.TouchCollection) { if (tl.State == TouchLocationState.Pressed || tl.State == TouchLocationState.Moved) { float playerPosHalfHeight = this.Position.Y + (this.Texture.Height/2); // Something fishy is going on here... if (tl.Position.Y >= playerPosHalfHeight) this.Velocity = new Vector2(0f, 0.25f); if (tl.Position.Y < playerPosHalfHeight) this.Velocity = new Vector2(0f, -0.25f); } if (tl.State == TouchLocationState.Released) { this.Velocity = new Vector2(0f, 0f); } } #endregion base.Update(gameTime); /* In other words... float delta = (float)gameTime.ElapsedGameTime.Milliseconds; Position += new Vector2(Velocity.X * delta, Velocity.Y * delta); */ #region Screen bounds check (top / bottom) if (this.Position.Y + this.Texture.Height > NinjaGame.Instance.GraphicsDevice.Viewport.Height) this.Position = new Vector2(this.Position.X, NinjaGame.Instance.GraphicsDevice.Viewport.Height - this.Texture.Height); if (this.Position.Y < 0f) this.Position = new Vector2(this.Position.X, 0f); #endregion } [/CODE] Thanks, happy coding.
  6. Thanks again man, I finally got some random lines with this code. [code] using System; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; using SlimDX; using SlimDX.Direct3D9; namespace SlimDXGUI { class Program { public struct LineVertex { public Vector3 Position { get; set; } public int Color { get; set; } } public class Form1 : Form { Direct3D d3d; Device device; LineVertex[] lineData; VertexBuffer vertexBuffer; System.Timers.Timer timer = new System.Timers.Timer(); Random rnd = new Random(DateTime.Now.Millisecond); protected override void OnLoad(EventArgs e) { d3d = new Direct3D(); PresentParameters pp = new PresentParameters(); pp.SwapEffect = SwapEffect.Discard; pp.DeviceWindowHandle = Handle; pp.Windowed = true; pp.BackBufferWidth = Width; pp.BackBufferHeight = Height; pp.BackBufferFormat = Format.A8R8G8B8; device = new Device(d3d, 0, DeviceType.Hardware, Handle, CreateFlags.HardwareVertexProcessing, pp); lineData = new LineVertex[100]; for (int i = 0; i < lineData.Length; i++) { lineData[i] = new LineVertex(); lineData[i].Position = new Vector3(0f, 0f, 0f); Color c = Color.FromArgb( rnd.Next(1, 255), rnd.Next(1, 255), rnd.Next(1, 255)); lineData[i].Color = c.ToArgb(); } timer.Interval = 10; timer.Start(); timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); } void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { Render(); } protected override void OnClosed(EventArgs e) { device.Dispose(); d3d.Dispose(); } public void Render() { device.Clear(ClearFlags.Target, Color.White.ToArgb(), 0f, 1); for (int i = 0; i < lineData.Length; i++) { float x = (float) (rnd.NextDouble() * 2) - 1; float y = (float) (rnd.NextDouble() * 2) - 1; lineData[i].Position = new Vector3(x, y, 0f); } device.BeginScene(); device.VertexFormat = VertexFormat.Position | VertexFormat.Diffuse; device.DrawUserPrimitives<LineVertex>(PrimitiveType.LineList, 0, lineData.Length / 2, lineData); device.EndScene(); device.Present(); } } [STAThread] public static void Main(string[] args) { using (Form1 form = new Form1()) { Application.Run(form); } } } } [/code]
  7. Sorry guys, I was confused with example number 6. The triangle uses shaders for movement. http://ogldev.atspace.org/www/tutorial06/tutorial06.html
  8. Unfortunately I don't understand much, but if could write a tutorial then I would be very happy.
  9. No, I want OpenGL 3 with VBO and Shaders, I know how to do it with OpenGL 1.5 but OpenGL 3 is less popular in this moment of speaking (that's why I am asking).
  10. Yep, I agree with Fetze (as I see you quoted my statement ) OpenTK is the future.
  11. Hi there, in this tutorial I learnt to draw a single point. http://ogldev.atspace.org/www/tutorial02/tutorial02.html Also in later lessons I learnt how to give motion to vertices. What I would like to do is to know how can I create a rain effect? [list=1][*]How to draw many points (raindrops)[*]How to know the speed of each raindrop.[*]How to know the bounds of lower and upper screen (inside the shader or outside in C++ code)?[/list]Any help will be much appreciated, thanks.
  12. I have started learning OpenGL 3.3 and 4.0 Very cool resources http://ogldev.atspace.org/ http://www.swiftless.com/opengltuts/opengl4tuts.html
  13. Here's an example for tetris [url="http://www.codeproject.com/KB/cs/moemeka4.aspx"]http://www.codeproject.com/KB/cs/moemeka4.aspx[/url] not essentially "easy" to understand, as they say in computer science) but it's practical.
  14. Here, this works for me nicely. I use OpenTK mostly but TAO also suits. [code] using System; using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; using Tao.OpenGl; namespace TaoForm { public partial class MainForm : Form { public MainForm() { InitializeComponent(); } void MainFormLoad(object sender, EventArgs e) { simpleOpenGlControl1.InitializeContexts(); Gl.glClearColor(0.0f, 0.0f, 1.0f, 0.0f); // Blue Gl.glMatrixMode(Gl.GL_PROJECTION); Gl.glLoadIdentity(); Gl.glOrtho(0f, 1f, 0f, 1f, -1f, 1f); } void MainFormPaint(object sender, PaintEventArgs e) { Gl.glClear(Gl.GL_COLOR_BUFFER_BIT); Gl.glBegin(Gl.GL_TRIANGLES); Gl.glVertex2d(0.5, 1.0); Gl.glVertex2d(0.0, 0.0); Gl.glVertex2d(1.0, 0.0); Gl.glEnd(); Gl.glFlush(); } } } [/code]
  15. Thanks for your answer unbird , I had look into it again and tried a few things. I made some changes but still no result. Here's what I did: [list=1][*]Studied the C++ edition (http://www.drunkenhyena.com/cgi-bin/view_cpp_article.pl?chapter=2;article=21)[*]Changed the struct name to [i]LineVertex[/i] and [i]data[/i] name to [i]lineData[/i].[*]LineVertex struct has a Vector4 for position instead of previously Vector3.[*]The Z Position of line is 1.0f (previously was 0.0f)[*]Made a change to DrawUserPrimitives method.[/list]Any opinions? If you have any ideas please post them because there are not enough resources on SlimDX, I do most of the learning from C++ codebase. [code] using System; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; using SlimDX; using SlimDX.Direct3D9; namespace SlimDXGUI { class Program { public struct LineVertex { public Vector4 Position { get; set; } public int Color { get; set; } } public class Form1 : Form { Direct3D d3d; Device device; LineVertex[] lineData; VertexBuffer vertexBuffer; protected override void OnLoad(EventArgs e) { d3d = new Direct3D(); PresentParameters pp = new PresentParameters(); pp.SwapEffect = SwapEffect.Discard; pp.DeviceWindowHandle = Handle; pp.Windowed = true; pp.BackBufferWidth = Width; pp.BackBufferHeight = Height; pp.BackBufferFormat = Format.A8R8G8B8; device = new Device(d3d, 0, DeviceType.Hardware, Handle, CreateFlags.HardwareVertexProcessing, pp); lineData = new LineVertex[100]; Random rnd = new Random(DateTime.Now.Millisecond); for (int i = 0; i < lineData.Length; i++) { lineData[i] = new LineVertex(); float x = (float) rnd.Next(0, Width); float y = (float) rnd.Next(0, Height); float z = 1.0f; lineData[i].Position = new Vector4(x, y, z, 0f); lineData[i].Color = Color.FromArgb( (int)(rnd.NextDouble() % 255), (int)(rnd.NextDouble() % 255), (int)(rnd.NextDouble() % 255)).ToArgb(); } } protected override void OnClosed(EventArgs e) { device.Dispose(); d3d.Dispose(); } public void Render() { device.Clear(ClearFlags.Target, new Color4(Color.White), 1.0f, 0); device.BeginScene(); device.VertexFormat = VertexFormat.Position | VertexFormat.Diffuse; device.DrawUserPrimitives(PrimitiveType.LineList, Marshal.SizeOf(typeof(LineVertex)), lineData.Length / 2, lineData); device.EndScene(); device.Present(); } } [STAThread] public static void Main(string[] args) { using (Form1 form = new Form1()) { Application.Run(form); } } } } [/code]