Jump to content
  • Advertisement
    1. Past hour
    2. Blueprint is coding so the idea that it's "making games without coding" is trivially false. It's more accessible, and thus easier to get into, but - at some point - the presentation method will limit the ability to manage a complex code base to the point it's easier to write more traditional code. Blueprint is Turing complete and has, AFAIK, access to everything within the Engine that you can access from C++, so I don't think there's anything of consequence you can't do within it. The question is performance and there, figures of about 10x slower are kicked around. There will be some applications for which that is an issue; but I don't think there are many.
    3. m a unity developer and recently i had an argue with unreal engine developer that says everything mechanic and game play can be achieved with unreal blueprint. basically blueprint is a scripting system like scratch language that lets you make logic by graph systems but how much far can it go? most of the time as a game developer i have to code some new algorithms, physics or AI and some special mechanics that it is very hard to imagine that you can implement with blueprint. i think game maker had a same system but i believe it was so limited and in the end you had to script some logics. i believe game making is about making new things and making games without coding is just an advertisement or rudimentary thinking. i dont think anyone can make a special or new idea with something like blueprint. can anyone give a good sight about this issue?
    4. Yeah, the key is getting life regen and leech, stacking up a whole bunch of leech stacks, and hoping for the best. I managed to beat it once with blades and almost once with lasers (ate a jbadams slam when he had like 5% of his life left). Now that the challenge is done, I might work on this some more.
    5. Hello everyone i am trying to make some simpleton game but having trouble with bullet objects behavior. in my game scene there is terrain shape for open world(which are nasty for now) and i am shooting some balls to check how terrain is doing. But some balls hit the terrain and some phase through so i don't know what to do or where exactly to dig. you can see the problem here i know video quality is bad but bare it for now please i still newbie for uploading. i guess you will get some clue what i am going through. Thanks in advance.
    6. Today
    7. Next part: Emit and Broadcast JSON
    8. mysteriousmonkey29

      Options/Advice for Selling Mod on Open-Source Game?

      Wow, this is cool! I checked it out and it seems to be more of a programmable adventure game than RTS (first person, managing one or a few robots at a time rather than a bird's eye view of a whole civilization). But it looks really fun and educational. I like the animation too. I think that bringing programmability to a competitive RTS would be different enough that it's still worth doing. Yeah, so maybe the way to do this is to host servers and charge either one-time to unlock access, or a subscription fee to play competitively (and include a free trial in either case). Or I could maybe host it through a platform like steam, which (I think) hosts servers for you, but then takes a significant cut of your profits. Need to look into this more. I very much like the idea of letting people who haven't paid watch people who have paid program and compete. It would be a good demo of how to do it/what is possible, as well as encouragement to buy it. Thanks for the feedback!
    9. Guys I took a close look at the team members for LootKit Studios from the job posting. If my interview is with Josh Howard, then according to the following website it shows that he's a software developer and founder himself . So he knows the programming lingo. It is a small company comprised of 4 people not including any backers for the project. The questions that I've posted above are programming questions. However you guys make a good point that I should focus on the company itself. I also found on Indeed career advice website this paragraph: The questions that I wrote above are, according to this quote, were to impress the interviewer. That is what the article is telling me NOT to do. I think a much better question might be focused on the role itself. For example the position is Unity Software Developer. I'm proficient with Unity,PC, and Android and not so much for IOS. As I know that Unity can port to different platforms, I should ask if this is what he's looking for. I also know that he has currently a Unity Developer on the team and he's looking for a second Unity Developer. So a follow up question is how I can fit into the team? https://angel.co/loot-kit-studios/jobs
    10. I will show differences between "emit" and "broadcast" on server side. In short: "emit" sends JSON data to a connected client "broadcast" sends JSON data to every client except the connected client At first time create a connection between the server and the client using this instruction: 101. Socket.io Connection, JS/ES5 We have this callback function in "app.js": io.sockets.on("connection", function(socket) { console.log("client was connected"); }); We will generate a name for a connected client on the server side. Client will get his own name from the server and will show it on the screen in a browser. We will use "shortid" module for generation names for clients. Install "shortid" package. Type this command in the console from your project folder: npm install --save shortid We will use "shortid" module to generate a random unique name. Let's show generated name: app.js var shortid = require('shortid'); io.sockets.on("connection", function(socket) { var clientName = shortid.generate(); console.log("client was connected, name = " + clientName); ); You will see a message in the console, like this: Let's create two buttons: "Get My Name" and "Send my Name to all Clients". Copy this code to server and to client sides. Do not forget to run the server by command: node app.js After this you need to open two clients in different browser tabs: http://localhost:8080/. Open the browser console, for example in Chrome: "Ctrl+Shift+J" and clear "cache" by RMB on "Reload" button and select "Empty Cache and Hard Reload". And do not forget reload the server when you made changes on the server side code. app.js var express = require("express"); var app = express(); var server = require("http").Server(app); app.get("/", function(req, res) { res.sendFile(__dirname + "/client/index.html"); }); app.use("/client", express.static(__dirname + "/client")); var port = 8080; server.listen(port); console.log("Server started. Port = " + port); var io = require("socket.io")(server, {}); var shortid = require('shortid'); io.sockets.on("connection", function(socket) { var clientName = shortid.generate(); console.log("client was connected, name = " + clientName); socket.on("getMyName", function() { socket.emit("onGetMyName", { name: clientName }); }); socket.on("sendMyNameToAllClients", function() { socket.broadcast.emit("onSendMyNameToAllClients", { name: clientName }); console.log(clientName); }); }); index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js"></script> <title>Multiplayer Snake</title> </head> <body> <button onclick="getMyName();">Get My Name</button> <button onclick="sendMyNameToAllClients();">Send my Name to all Clients</button> <script> var socket = io(); socket.emit("hello", { message: "hello from client!" }); socket.on("onGetMyName", function(data) { console.log("My Name: " + data.name); }); socket.on("onSendMyNameToAllClients", function(data) { console.log("Name of another client: " + data.name); }); function getMyName() { socket.emit("getMyName"); } function sendMyNameToAllClients() { socket.emit("sendMyNameToAllClients"); } </script> </body> </html>
    11. hi, for several hours yesterday i tried to solve my problem and got deeply frustrated, so i urgently need your help. In my indie game engine i have a special superfast sphere renderer. For visualizing fluid or particle effects. It works fine and has a really good performance. I get 5 million spheres (60 fps) ( animated/moved with full shading pipeline, metallnes, roughness, normal calculation) Technik: - no vertexbuffer, no indexbuffer binded Vertexshader : - rendering a rectangle with 4 vertecies, - positions calculated from the center position from the binded structured position buffer - fixed texcoords, - calculating depth of the rectangle in viewspace PixelShader: - calculating normal from tex coords, - calculation depth of the virtual point on the virtual sphere and adding to the depht of the sprite - write values to the gbuffer ( linear gbuffer ) the renderpass uses the same values for rasterizer, blendstate as all the other gbuffer renderpasses. My Problem is shown best in the following image. Although i conclude, that the depth values are correctly calculated, the values are NOT correctly written to the gbutter It seems to me, that - whenever one sprite overlaps/covers an area of another sprite - only the depth values of that sprite are written - that has the "deeper" "center depth" of the sprite, => so the true pixel calculated desired depth value is neglected The simulation is nevertheless good visualized, but the negative effect is, that whenever the center depth of a neighbour sphere gets in front of another sphere the normals of the whole overlaping area make a hopping which does not look good . Please could help me someone of the kind developers with more skill than i. Thanks in advance P.S. All the examples i could find about my method always use "point sprite technic" that according to my study is available in directx 9 but is NOT available in directx 11
    12. Just to cover myself here, some people might argue against creating meshes (buffers) with very small amounts of data (like a quad). Also, if you have a lot of quads (e.g. hundreds) and are making a draw call per quad, that might have some performance implications, depending on the context. That said, if the number of quads is modest and/or you don't encounter any performance issues, you might be able to get away with doing it this way. I don't have anything handy, but of the terms you could search for, 'sprite batching' might yield the best results
    13. Does it work if you turn off blending?
    14. I like the idea! I'd say, you'd need to start with the smallest things of the kind anybody can do. Waste properly separated? Get an achievement! Water saved? Level up! The key thing here needs to be that players want to become better, save even more energy and so on. For that, the "mmo" factor can really help as players would be able to compare their progress with their friends'. Also, data would make it easier for people. Make it quick and easy for them to research. Where and how is product x produced? Are there light bulbs available that are more efficient than my current ones? Can I trust, my meat is not from maltreated animals? Oh you really checked? Cool, here's some exp for you! This, of course, is just what first came to mind ^^
    15. pindrought

      Some questions about UDP in C++

      Okay thank you very much. This cleared up a lot of confusion I was having. However, I tried to make a very basic server/client and i'm running into some issues. I want this to function where the client will just send the server 4 byte packets with an unsigned 32 bit integer that increments from 0. When the server gets the packet, it should echo it back to the client. Currently i'm not concerned with dropped, repeated, out of order packets. This is the code I came up with. Sorry about the length, I tried to make it as short as I could for this example. #include <WinSock2.h> #include <WS2tcpip.h> #pragma comment(lib,"ws2_32.lib") #include <iostream> #define HOSTIP "192.168.0.11" enum RunType { Server, Client }; RunType runtype = RunType::Server; void DoServer() { SOCKET serverSocketHandle = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (serverSocketHandle == NULL) { std::cerr << "Failed to create socket" << std::endl; return; } DWORD nonBlocking = 1; if (ioctlsocket(serverSocketHandle, FIONBIO, &nonBlocking) != 0) { std::cerr << "Failed to set socket non-blocking." << std::endl; return; } sockaddr_in listenAddress; listenAddress.sin_family = AF_INET; listenAddress.sin_addr.s_addr = INADDR_ANY; listenAddress.sin_port = htons(8000); int listenAddressSize = sizeof(listenAddress); if (bind(serverSocketHandle,(const sockaddr*)&listenAddress,sizeof(sockaddr_in)) < 0) { std::cerr << "Failed to bind socket." << std::endl; return; } uint32_t recvPacketCounter = 0; while (true) { if (GetAsyncKeyState(VK_ESCAPE)) return; if (recvfrom(serverSocketHandle, (char*)(&recvPacketCounter), sizeof(uint32_t), NULL, (sockaddr*)&listenAddress, &listenAddressSize) > 0) //Server is receiving messages { sendto(serverSocketHandle, (char*)&recvPacketCounter, sizeof(uint32_t), NULL, (sockaddr*)&listenAddress, sizeof(sockaddr_in)); //This send is never being picked up by the client? recvPacketCounter = ntohl(recvPacketCounter); std::cout << "Server - [Sender Port: " << ntohs(listenAddress.sin_port) << "] Echoing packet: " << recvPacketCounter << std::endl; } } } void DoClient() { SOCKET clientSocketHandle = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (clientSocketHandle == NULL) { std::cerr << "Failed to create socket" << std::endl; return; } DWORD nonBlocking = 1; if (ioctlsocket(clientSocketHandle, FIONBIO, &nonBlocking) != 0) { std::cerr << "Failed to set socket non-blocking." << std::endl; return; } uint32_t ip = INADDR_NONE; inet_pton(AF_INET, HOSTIP, &ip); if (ip == INADDR_NONE) { std::cerr << "Failed to resolve host." << std::endl; return; } uint32_t hostip = INADDR_NONE; inet_pton(AF_INET, HOSTIP, &hostip); if (hostip == INADDR_NONE) { std::cerr << "Failed to resolve host ip." << std::endl; return; } sockaddr_in sendtoAddress; sendtoAddress.sin_family = AF_INET; sendtoAddress.sin_addr.s_addr = hostip; sendtoAddress.sin_port = htons(8000); sockaddr_in recvAddress; recvAddress.sin_family = AF_INET; recvAddress.sin_addr.s_addr = INADDR_ANY; recvAddress.sin_port = 0; //Not specifying a port for client so an available port will be selected when binding int recvAddressSize = sizeof(recvAddress); if (bind(clientSocketHandle, (const sockaddr*)&recvAddress, sizeof(sockaddr_in)) < 0) { std::cerr << "Failed to bind socket." << std::endl; return; } uint32_t packetCounter = 0; uint32_t recvPacketCounter = 0; while (true) { if (GetAsyncKeyState(VK_ESCAPE)) return; uint32_t tempval = packetCounter; tempval = htonl(tempval); sendto(clientSocketHandle, (char*)(&tempval), sizeof(uint32_t), NULL, (sockaddr*)&sendtoAddress, sizeof(sockaddr_in)); //<-This works if (recvfrom(clientSocketHandle, (char*)(&recvPacketCounter), sizeof(uint32_t), NULL, (sockaddr*)&recvAddress, &recvAddressSize) > 0) //<-Never receiving a message { recvPacketCounter = ntohl(recvPacketCounter); std::cout << "Client - [Sender Port: " << ntohs(recvAddress.sin_port) << "] Received packet: " << recvPacketCounter << std::endl; } Sleep(100); packetCounter += 1; } } int main() { char input = 0; while (input != 'c' && input != 's') { std::cout << "Enter 'c' for client or 's' for server:"; std::cin >> input; } if (input == 's') runtype = RunType::Server; else runtype = RunType::Client; WSADATA init; if (WSAStartup(MAKEWORD(2, 2), &init) != 0) { std::cerr << "WSA Startup failed with error code: " << WSAGetLastError() << std::endl; return -1; } if (runtype == RunType::Server) { DoServer(); } if (runtype == RunType::Client) { DoClient(); } WSACleanup(); std::cout << "Program end." << std::endl; return 0; } If I run the server/client on the same machine, it appears to work fine. However, I know something must be wrong because when I run the server on one machine and the client on another, I get different behavior. When I run the server/client on different machines, only the server will be printing out that it is receiving packets. It seems like the client is not set up right to properly receive the packets from the server. Is there anything that sticks out that I did wrong here to cause this issue?
    16. In addition to what lawnjelly said, unless there's some aspect of the problem you haven't mentioned, it doesn't sound like the problem concerns OpenGL. That may be causing some confusion, so perhaps reframing the question without reference to OpenGL might help clarify things (assuming it's not in fact OpenGL-related). Perhaps you could also clarify what you mean by 'repeatedly check every height'.
    17. It seems you are dependant on the order of the triangles processed/drawn
    18. Some may remember that I got poked by private investors a year or so ago because of my GameDev blog. Well, it has finally yielded the first, minor project. And it's a bit of a challenge! They want me to draw up a mockup of a game that essentially gamifies saving the world. A "game" in which players must llevel up territories, people and themselves in the real world, to progress in the game. Needless to say, it's sort of an MMO, but I have no idea what letters to add to that. MMOARG? MMONGO? (yes, I am sitting here making those sounds, now, too!). I jotted my first ideas down on my GameDev blog, but I would like to get a discussion going, somehow. I need to throw this ball around to get my head, literally, in the game! So I ask the good people in here: What thoughts go through your head when I talk about a game that rewards players for asserting positive influences on the world around them? How could a game be designed to help improve the world? ANY idea is welcome!!! Sorry it's a bit short, but my head is kinda spinning from this one...
    19. Embassy of Time

      A game to save the (real!) world?

      Little over a year ago, my blog postings on science in games inspired a small private investor to track me down for a chat. We talked about the next big ideas in games and how games connect to the real world. He eventually had me meet a few of his fellow investors to do a quick presentation. Ever since, there's been a slow and irregular back and forth about what could be a fun project to try. In December, they picked one. Sort of. For those few unaware, "gamification" is a fairly hot topic in certain circles. None of the people talking to me are in games development as such, but they took a liking to the concept. So I now have a little bit of financing to research how to make a game, from this outline: The game challenges its players to make significant improvements to their real-world lives and surroundings, awarding creative and organized problemsolving of real-world problems. That's the sum of it. The rest is up to me, to show that this line, and the many concepts discussed while coining it, can be turned into an actually entertaining game, with lasting effects. That should be.... easy? Work In Progress: The Basic Premise How do you turn "save the world" into a game? The same way you eat an elephant, I guess: One small bite at a time. The first bite is to turn "improve your life and the world around you" into some form of award system, such as points, achievements, etc. My current thoughts revolve around a real-world version of RPGs, e.g. character building, combined with a strategy game (4X, RTS, whatever) territory concept. In short, build a group of skilled members and level up a clearly defined geographical area. Levelling up an area could boost the value of character traits, or build some kind of faction reputation, opening up new abilities and possibilities. Work In Progress: The Real-World Connection The first layout is to have those characters be actual people. Players can join up with various teams (parties, in a way) to take part in projects (an equivalent to raids, maybe?), and players can bring their own allies and skills to the pot. The territories that projects take place inside will likely be based on actual geography, likely something like counties, neighbourhoods, blocks and the like. Specific criteria must be met (and documented) to raise a territory by a level. In short, players join up to level up their chosen (captured?) territory by making certain improvements. But that's all very nebulous, and not all that original, little more than awarding your child "points" for cleaning their room and taking out the trash. The specifics will be in the actual criteria. Upgrading players is a bit different. Much of it will basically be training, using tests available through the game to evaluate and even teach new skills. Yes, we're talking edutainment *shiver* The skills will be more practically minded,of course, aimed at boosting the player's efforts in the game, in the short or long term. An added step as characters, territories and teams progress will be the availability of real-world alliances. Local projects that exist beyond the game, such as humanitarian and charity work, can open up for volunteers from the game, making them effectively NPC allies, or even "mission boards", and allowing their skills to influence players as they try to progress. A local fire department could be the access to extended First Aid training, for example, or wildlife projects could add training in ecology and animal sciences. Work In Progress: The Technological Platform This is not going to be simply some graphics on a screen. But that will be a key part of the game! Much of the visuals will likely be inspired by existing strategy games, showing territories, resources, players, and more. This can be boosted with features taken from social media, showing the efforts and challenges of players and territories. The big question, of course, goes back to that original issue of quantifying progress. Missions/projects will yield reputation, as will player progress, and the total progress of a team will be a possible score for comparison. Recruiting valuable players across teams will be a contentious issue, of course, but there is room for freelancing teams that help across territories. Being responsible for a territory is another possible way to affect a score, with territories yielding more respect as they level up. In The End..... This is just the earliest scrape of the surface. To create something sensible, comprehensible, and most of all worth taking part in, the details need to advance far beyond these basic ideas. But everything has to start somewhere!
    20. In general, this is what I got: uniform struct CinematicDOF { vec3 focusPosition; // in camera space, -z ^ float a; // aperture float i; // image distance } cinematicDOF; ... float p = -cinematicDOF.focusPosition.z; float f = (p + cinematicDOF.i) / (p * cinematicDOF.i); float d = sqrt(pow(cinematicDOF.focusPosition.x - fragPos.x, 2) + pow(cinematicDOF.focusPosition.y - fragPos.y, 2) + pow(fragPos.z, 2)); dof = abs((cinematicDOF.a * f * (p - d)) / (d * (p - f))); but apparently something did not understand, or somewhere wrong. Blur affects only distant objects; it does not apply to nearby objects Focus on the cursor: I will be grateful for help!
    21. 8Observer8

      c# console snake game

      @phil67rpg do you have a plan to start learning of WPF instead of WinForms in the future? WinForms uses GDI (CPU - Central Processor Unit on central processor for rendering graphics) and it is very slowly than WPF because WPF use a graphics card on the hood (GPU - Graphics Processor Unit on graphics card for rendering graphics). Do not afraid XAML. You can create graphics from C# code like in WinForms. XAML you can study later. XAML is like HTML. It is not difficult and it is more confiniant than WinForms. I think it is better do not spend time with WinForms. It is ideal to embed OpenTK.GLControl to use OpenGL 3 in you WinForms or WPF application. Or you can create GameWindow from Console Project using OpenTK. Studying WPF Graphics is good to because we have a great book about computer graphics that use WPF C#: 2013 - 06 - Computer Graphics Principles and Practice - 3rd Edition - John F. Hughes, Andries van Dam, Morgan McGuire, David F. Sklar, James D. Foley, Steven K. Feiner, Kurt Akeley. Source Code: http://cgpp.net/about.xml
    22. 8Observer8

      c# console snake game

      I added timer2 which sets a new random direction every 500 milliseconds: using System; using System.Drawing; using System.Windows.Forms; namespace SnakeByPhil_WinFormsGDI { public partial class Form1 : Form { public Form1() { InitializeComponent(); CenterToScreen(); timer1.Interval = 200; timer2.Interval = 500; timer2.Start(); } private void Form1_Paint(object sender, PaintEventArgs e) { Graphics g = this.CreateGraphics(); SolidBrush greenBrush = new SolidBrush(Color.Green); SolidBrush blackBrush = new SolidBrush(Color.Black); //Rectangle rect_green = new Rectangle(340 + x, 280 + y, 10, 10); //Rectangle rect_black = new Rectangle(330 + x, 280 + y, 10, 10); Rectangle rect_green = new Rectangle(150 + x, 150 + y, 10, 10); Rectangle rect_black = new Rectangle(140 + x, 150 + y, 10, 10); g.FillRectangle(greenBrush, rect_green); g.FillRectangle(blackBrush, rect_black); greenBrush.Dispose(); g.Dispose(); } int x = 0, y = 0; Random rnd = new Random(); int move = 1; private void timer2_Tick(object sender, EventArgs e) { move = rnd.Next(1, 5); Console.WriteLine(move); } private void timer1_Tick(object sender, EventArgs e) { switch (move) { case 1: for (int i = 0; i <= 20; i++) { x++; } break; case 2: for (int i = 0; i <= 20; i++) { x--; } break; case 3: for (int i = 0; i <= 20; i++) { y++; } break; case 4: for (int i = 0; i <= 20; i++) { y--; } break; } if (MouseButtons == MouseButtons.Left) { } Invalidate(); } } }
    23. Unfortunately no (I don't know Direct3D at all and I'm also not enough of a 3D graphics expert in general, I fear), but I noticed something which could perhaps be of help: You wrote that the error depends on the camera angle, but I think it looks like it actually depends on the camera position: The tiles that are wrongly rendered over the "spikes" are always right of the current camera position. The pattern doesn't change when you rotate the camera, it changes when you move it. Apart from that, I think it's some kind of z-buffer (depth write/test) error, as Irusan has already stated. However, I have no idea what exactly is wrong. It looks really weird and unlike anything I've ever seen.
    24. 8Observer8

      c# console snake game

      I think "more difficult"... that's a subjective concept. For me making a ASCII snake game is more difficult than a snake game using: GDI/WinForms, OpenGL/OpenTK, WPF or Unity. I will add the smooth animation later. I think how to make it simpler. The classic game game does not have the smooth animation. But it is very interesting.
    25. lawnjelly

      Checking a Height Value Repeatedly

      The question is very unclear, you would probably benefit from adding one or several diagrams, and a link to this code you have found.
    26. Thanks for the answer Hodgman! I'll take a look at the link.
    27. MordredX

      Psy - Dungeon Challenge

      Amazing retro aesthetics. Loved it. I will try it out as soon as I can. Cheers, r1ckparker,
    28. Note: This article was originally published on LinkedIn. If you enjoy my article, please click through and consider connecting with me. Can programmers art? How far can creativity and programming take you? I have summarized what I learned in several months into 7 key techniques to improve the visual quality of your game. "Programmer art" is something of a running joke. For those unfamiliar with the term, it refers to the "placeholder" or "throw-together" art that programmers tend to use while developing games. Some of us don't have the necessary artistic skills, however, sometimes we just can't be bothered to put in the effort. We're concerned about the technical side of things working - art can come later. Here's what this usually means - I worked on a game jam with some new people a few months ago. I just wanted to make sure that my gameplay and AI code was doing what it was supposed to do. This would have to interface with code from other teammates as well, so it was important to test and check for bugs. This was the result. That's not what I'm going to talk about today though. I'm going to take a different angle on "programmer art" - not the joke art that programmers often use, but the fact that there's a LOT that a programmer can do to improve the visual appeal of a game. I believe some of this falls under "technical art" as well. My current job kind of forced me to think in this capacity. I was tasked with visualizing some scientific data. Though this data was the result of years of hard work on the part of scientists, the result was unimpressive to the untrained eye - a heap of excel files with some words and numbers. There are very few people in the world who can get excited by seeing a few excel files. My job? To make this data exciting to everyone else. My task was to visualize connectome data for a famous worm known as C. Elegans, made available by the wonderful people working on the OpenWorm project. Part of the data parsing to read and display the data as a worm's body with neurons on it was done by my teammate. My main task was to improve the visuals and the overall graphical quality. The first thing that comes to mind is using HD textures, PBR materials and high-poly models. Add in a 3D terrain using a height map, some post-processing and HDR lighting, and BOOM! Gorgeous 3D scene. I'm sure you've all seen loads of those by now. Except, almost none of that would really help me. The idea was very abstract - neurons and connections visible in a zoomed-in, x-ray-like view of a worm. I don't think rolling hills would have helped me much. I had no 3D modelling skills or access to an artist - even if I did, I'm not sure what kind of 3D models would have helped. As a result, what I've made isn't a gorgeous 3D environment with foliage and god-rays and lens flares. So it's not applicable in every case or the perfect example of how a programmer can make a gorgeous game. But, it does provide a distinct viewpoint and result. The special sets of constraints in the problem I had to solve led to this. So here's what I actually did: The 7 things I did to improve the visuals of my Unity game 1. Conceptualizing the look This could be considered a pre-production step for art or any visual project. Ideally, what should it look like? What's the goal? What are your references? In this case, the viewer had a hologram-like feel to it (also there were plans to port it to a HoloLens eventually). I liked the idea of a futuristic hologram. And the metaphor of "AI bringing us towards a better future". So what were my references? Sci-fi of course! My first pick was one of my favourite franchises - Star Wars. I love how the holo-comms look in the movies. Holograms became a key component of my design. This is a HUD design from Prometheus that I found on Google - In this case, the colours appealed to me more than the design itself. I ended up basing the UI design on this concept. Key takeaway - Your imagination is the very first tool that helps you create impressive art. Use references! It's not cheating - it's inspiration. Your references will guide you as you create the look that you want. 2. Shaders can help you achieve that look I had some shader programming experience from University - D3D11 and HLSL. But that work had been about building a basic graphics engine with features like lighting, shadows, and some light post-processing. I had done some light Shader programming in Unity before as well. What I really needed now was impressive visual effects, not basic lighting and shadows. I was really lucky that this was about the time Unity made Shader Graph available, which made everything much easier. I can write Shader code, but being able to see in real time what each node (Which can be considered a line of code) does makes it so much easier to produce the effects you want. I familiarized myself with all the samples Unity had included with this new tool. That wouldn't have been enough though. Thankfully due to my previous experience with Shaders, I was able to make some adjustments and improvements to make them suit my needs. Some tweaking with speed, scaling, colours, and textures led to a nice hologram effect for the UI panels. I wanted the viewer to feel good to interact with as well, and some work implementing a glow effect (alongside the dissolve effects) led to this - Key takeaway - Shaders are an extremely powerful tool in a Game Programmer's repertoire. Tools like Unity's Shader Graph, the old Shader Forge asset, and Unreal's material editor make Shaders more accessible and easier to tune to get the exact look you want. PS - Step 5 below is also really important for getting a nice glow effect. 3. Visual Effects and Animations using Shaders I was able to extend the dissolve and hologram shaders to fake some animation-like visual effects. And a combination of some timed Sine curves let me create an animation using the dissolve effect - The work here was to move the animation smoothly across individual neuron objects. The animation makes it look like they're a single connected object, but they're actually individual Sphere meshes with the Shader applied to them. This is made possible by applying the dissolve texture in World Space instead of Object Space. A single shader graph for the neurons had functionality for colour blending, glow, and dissolve animation. All of this made the graphs really large and difficult to work with though. Unity was constantly updating the Shader Graph tools, and the new updates include sub-graphs which make it much easier to manage. Key takeaway - There is more to shaders than meets the eye. As you gain familiarity with them, there are very few limits to the effects you can create. You can create animations and visual effects using Shaders too. 4. Particle systems - more than just trails and sparks I have no idea why I put off working with the particle systems for so long! The "neurons" in the viewer were just spheres, which was pretty boring. Once I started to understand the basics of the particle system, I could see how powerful it was. I worked on some samples from great YouTube tutorials - I'm sharing a great one by Gabriel Aguiar in the comments below. After that, I opened up Photoshop and experimented with different brushes to create Particle textures. Once again, I referred to my sources of what neurons should look like. I wanted a similar look of "hair-like" connections coming out of the neurons, and the core being bright and dense. This is what it looked like finished, and the particle system even let me create a nice pulsating effect. Part of my work was also parsing a ton of "playback data" of neurons firing. I wanted this to look like bright beams of light, travelling from neuron to neuron. This involved some pathfinding and multi-threading work as well. Lastly, I decided to add a sort of feedback effect of neurons firing. This way, you can see where a signal is originating and where it's ending. Key takeaway - Particle systems can be used in many ways, not just for sparks and trails. Here, I used them to represent a rather abstract object, a neuron. They can be applied wherever a visual effect or a form of visual "feedback" seems relevant. 5. Post-processing to tie the graphics and art together Post-processing makes a HUGE difference in the look of a game scene. It's not just about colours and tone, there's much more to it than that. You can easily adjust colours, brightness, contrast, and add effects such as bloom, motion blur, vignette, and screen-space reflections. First of all, Linear colour space with HDR enabled makes a huge difference - make sure you try this out. Next, Unity's new post-processing stack makes a lot of options available without impacting performance much. The glow around the edges of the sphere only appears with an HDR colour selected for the shader, HDR enabled, and Linear colour space. Post-processing helps bump this up too - bloom is one of the most important settings for this. Colour grading can be used to provide a warm or cool look to your entire scene. It's like applying a filter on top of the scene, as you would to an image in Photoshop. You can completely override the colours, desaturate to black and white, bump up the contrast, or apply a single colour to the whole scene. There is a great tutorial from Unity for getting that HD look in your scenes - if you want a visible glow you normally associate with beautiful games, you need to check this out. Key takeaway - Post processing ties everything together, and helps certain effects like glows stand out. 6. Timing and animation curves for better "feel" This is a core concept of animation. I have some training in graphic design and animation, which is where I picked this up. I'm not sure about the proper term for it - timing, animation curves, tween, etc. Basically, if you're animating something, it's rarely best to do it with linear timing. Instead, you want curves like this - Or more crazy ones for more "bouncy" or cartoon-ish effects. I applied this to the glow effects on the neurons, as I showed earlier. And you can use this sparingly when working with particle systems as well - for speed, size, and similar effects. I used this for the effect of neurons firing, which is like a green "explosion" outwards. The particles move outwards fast and then slow down. Unity has Animation Curve components you can attach to objects. You can set the curve using a GUI and then query it in your C# scripts. Definitely worth learning about. Key takeaway - Curves or tweens are an animation concept that is easy to pick up and apply. It can be a key differentiator for whether your animations and overall game look polished or not. 7. Colour Palettes and Colour Theory - Often overlooked Colour is something that I tend to experiment with and work with based on my instincts. I like being creative, however, I really underestimated the benefits of applying colour theory and using palettes. Here's the before - Here are some of the afters - I implemented multiple themes because they all looked so good. I used a tool from Adobe for palettes, called Adobe Colour - link in the comments. I basically messed around with different types of "Colour harmony" - Monochrome, triad, complementary, and more. I also borrowed some colours from my references and built around that. Key takeaway - Don't underestimate the importance of colour and colour theory. Keep your initial concept and references in mind when choosing colours. This adds to that final, polished look you want. Bonus - consider procedural art Procedural Generation is just an amazing technique. I didn't apply it on this project, but I learned the basics of it such as generating Value and Perlin noise, generating and using Height maps for terrains, and generating mazes. Procedural art is definitely something I want to explore more. A couple of interesting things (Links in the "extra resources" section below) - Google deepdream has been used to generate art. There's an open-source AI project that can colour lineart. Kate Compton has a lot of interesting projects and resources about PCG and generative art. I hope this leads to tools that can be directly applied to Game Development. To support the creation of art for games. I hope I get the opportunity to create something like that myself too. Conclusion These 7 techniques were at the core of what I did to improve the visual quality of my project. This was mostly the result of the unique set of constraints that I had. But I'm pretty sure some famous person said: "true creativity is born of constraints". Or something along those lines. It basically means that constraints and problems help channel your creativity. I'm sure there is more that I could have done, but I was happy with the stark difference between the "before" and "after" states of my project. I've also realized that this project has made me more of an artist. If you work on visual quality even as a programmer, you practice and sharpen your artistic abilities, and end up becoming something of an artist yourself. Thanks for reading! Please like, share, and comment if you enjoyed this article. Did I miss something obvious? Let me know in the comments! Extra Resources OpenWorm project Great tutorial by Gabriel Aguiar Unity breaks down how to improve the look of a game using Post processing Another resource on post-processing by Dilmer Valecillos Brackey's tutorial on post-processing Adobe Colour wheel, great for colour theory and palettes An open-source AI project that can colour lineart A demo of generative art by Kate Compton Note: This article was originally published on LinkedIn. If you like it, please click through, get in contact, and consider connecting.
    29. Are you doing anything to enable depth writing and testing? I don't see anything in your posted code? If not, that's probably the problem.
    30. duke_meister

      c# console snake game

      There's not enough there yet to comment on. Idea: have a look at the structure of the game on my blog. Maybe an exercise would be to take that structure and turn it into a GDI version. I could help with that. Or if you're interested in learning gradually, I could start another blog and build the game up step by step? By the way, a GDI snake game is more difficult in my opinion. Anyway. Draw on a Panel. Make sure double buffering is set on the form/panel. https://stackoverflow.com/questions/4305011/c-sharp-panel-for-drawing-graphics-and-scrolling?noredirect=1&amp;lq=1 BTW My blog is
    31. Would posting more code help?
    32. I was able to beat the game with the following mods: I pretty much ran into the mobs as both end bosses came in and my blade killed them so quick and my regen saved me. Was like a second fight! I did die when I couldn't get them at the same time with a mob of guys due to no extra leech. Great job! I really enjoyed it!
    33. Irusan, son of Arusan

      Appropriate questions to ask in interview

      An interview has two purposes: for them to find out if they want to hire you and for you to find out if you want to work there. The second half of that is often neglected or even forgotten entirely. The questions you are at the end are one of your prime opportunities to put them on the spot about whether you want to work for them. I think the chances that you can ask a question that impresses them so much that you will change a "not hire" into a "hire" decision on their part is basically zero. The decision on whether to hire you or not will be made based on your CV and the earlier, employer-led, part of the interview, so there is little value in trying to come up with questions that will impress them, instead I suggest you use this as a valuable opportunity to ask about the company you may be joining. If they haven't shown you where you will be working, ask about that; if you'll be relocating, ask about the area and whether the company provides any help for finding a place, etc.; ask about their approach to programming, or the way the company structures the day, or child-care issues, or whatever it is that matters to you about a place you're going to work. Good luck with the interview!
    34. jinxiao

      Irrlicht with QT

      I want to write my own irrlicht scene editor with QT. I create a class QIrrlichtWidget which derived from the QWidget, and reimplement the "paintEvent" mehtod to drive the Irrlicht drawing loop. //.h class QIrrlichtWidget : public QWidget { signals: void updateIrrlicht( ); public slots: void autoUpdateIrrlicht(); protected: virtual void paintEvent ( QPaintEvent * event ); } //.cpp QIrrlichtWidget::QIrrlichtWidget(QWidget *parent) : QWidget(parent) { connect( this, SIGNAL(updateIrrlicht()), this, SLOT(autoUpdateIrrlicht()) ); } void QIrrlichtWidget::paintEvent(QPaintEvent *event) { if ( m_device ) { emit updateIrrlicht( m_device ); } } void QIrrlichtWidget::autoUpdateIrrlicht() { if(m_device->run()) { m_device->getTimer()->tick(); m_driver->beginScene(true, true, irr::video::SColor(255,125,0,0)); m_scene->drawAll(); m_guienv->drawAll(); m_driver->endScene(); } } but the QT throw the "QWidget::repaint: Recursive repaint detected" exception. so, I use the Qt timer to avoid using the paintEvent. QIrrlichtWidget::QIrrlichtWidget(QWidget *parent) : QWidget(parent) { connect( this, SIGNAL(updateIrrlicht()), this, SLOT(autoUpdateIrrlicht()) ); startTimer(0); } void QIrrlichtWidget::timerEvent(QTimerEvent * event) { if ( m_device ) { emit updateIrrlicht( m_device ); } event->accept(); } http://ww1.sinaimg.cn/large/a011c7abgy1g09hl7t6e1j20x10jy3zr.jpg It is works well. But, there are still some problems. When I pass the QT mouse events to irrlicht engine, and operate the objects in irrlicht scene, the user experience is too bad. There are some delays that cannot be tolerated. So, do anyone have any good ideas to solve the problem?
    35. I'm sorry, but... what? What does this even mean? The point of asking questions to an interviewer is for you to get information that can help you make a decision about whether you want to work there. Those two questions you posted above are pretty much completely pointless. Not only might the interviewer not even know the details of those things, but it tells you absolutely nothing about the company, the team, the person you're talking to, or anything else that's of any use to you.
    36. Olivier Girardot

      My Footsteps Sound Effects !

      Hi Rutin ! Thanks again for your support ! Yes I do music as well, as a matter of fact I initially started as a music composer and found a new passion for sound design on the way. Here is my music website, it's much less video game oriented: http://www.ogmusik.com
    37. There was a discussion recently on making TCP-websockets behave a little more UDP-like. If you're doing a networking model that works well with unreliable streams (e.g. shooters), then this might be worth a look: People have developed fast paced shooters on Websockets, despite TCP not being ideal. RTS games often use lock-step networking models that work well on TCP.
    38. I'm guessing the answer to this question depends on the game. As far I've read so far (and I might be wrong): Websockets behave similar to TCP. Which means some packets are held back and sent later in specific situations. UDP on the other hand sends all packets without holding any, at the expense of losing some of them. I've also noticed that most developers seem to recommend using UDP at all cost, and that UDP is not available for web. If my understanding is correct, what kind of games can I reliably make with Websockets? Is the performance of websockets too bad for fps, rts, or real-time rpg games?
    39. Thanks for you answer Irusan, it's appreciated. Excellent, making individual meshes is what I thought was a good idea. Thanks a lot for your answer. I never heard of dynamic batching with streamed mesh data. I'm googling it right now, but I'm not sure what I'm looking for to be honest. Would have a link to some good documentation? Thanks again!
    40. Hi Fleabay, I understand what you're talking about now, it makes sense now. Thanks. This not only applies to this interview but others as well.
    41. Julie.chan

      Options/Advice for Selling Mod on Open-Source Game?

      I haven't tried it, but I think that already exists: https://colobot.info/ It seems to just be single-player, but adding multi-player to Colobot might be easier than making a whole new programming RTS. In the case of a multiplayer game, you can make money by hosting a server and charging for access to it. Yeah, that sounds like a nice idea. Actually, I wish more people would do this kind of thing. You'd just need to modify the game so you can run a premium server of sorts. Just one modification/clarification: anyone who receives a copy of a program under the GPL has to be given access to the corresponding source code, so while you don't need to advertise it, you still need to include either the source code or access to the source code for everyone who gets a copy of the binary from you (I usually just give everyone source code directly because that's simpler, but it depends how big the source tree is I figure). And one little suggestion/idea: make it so that people who haven't paid for access can still watch games on your server. That can help entice them to want access.
    42. Rutin

      A Low requeriments Engine?

      Then I would suggest you look into LITIengine -> https://litiengine.com/ If you actually want to program your own stuff using a framework then you do have options like: libGDX -> https://libgdx.badlogicgames.com/ Let me know if you still need some suggestions.
    43. CosmosDevelopment

      A Low requeriments Engine?

      System -Windows 10 Graphics Card - Intel(R) HD Graphics I Have Experience Programing In Java Also I Want to Export My Game To Nintendo Switch 💜
    44. invent71

      IRIDIUM Demo and Kickstarter

      Hi GameDevs, We have been busy working on a new Retro Shoot em up called "IRIDIUM", A frantic new 2D shoot 'em up with huge levels and truly massive enemy ships. Mixing game styles from Uridium, Xenon 2 and Nemesis. We do have a demo to play for PC https://nebula-design.itch.io/iridium If you love shootemups as much as us, please let us know your thoughts. Some example images below We'd love to get this on NintendoSwitch if we can reach our goal.
    45. duke_meister

      Mostly done

      using System; using System.Diagnostics; using System.Linq; using System.Threading; using System.Threading.Tasks; namespace ConsoleSnake { /// <summary> /// All code written by duke_meister (Valentino Rossi) /// except keyboard reading technique /// </summary> class Program { // our unchanging values: // playfield height & width const int PlayfieldWidth = 80; const int PlayfieldHeight = 40; // game pieces const string EmptyCell = " "; const string SnakeHeadCell = "@"; const string SnakeBodyCell = "o"; const string FoodCell = "."; // timeout to adjust speed of snake static int MillisecondsTimeout = 50; // our playfield; stores FieldVals instead of ints so we don't have to remember them static readonly FieldVals[,] PlayField = new FieldVals[PlayfieldWidth, PlayfieldHeight]; // not yet used until we increase length of snake static int _snakeBodyLen = 4; // not including head // which direction (SnakdDirs enum) the snake is currently moving static SnakeDirs _snakeDir; // position of the one-and-only piece of food; use our own coordinate class, Pos static readonly Pos FoodPos = new Pos(0, 0); static readonly Pos EraserPos = new Pos(0, 0); // defines the snake; each element tells us which coordinates each snake piece is at static int _maxSnakeLen = 20; static Pos[] _snakeCells = new Pos[_maxSnakeLen]; // guess static int _score = 0; // for randomizing things like food placement static Random _rnd; // how many body pieces the snake will increase by when it eats food static int SnakeSizeIncrease = 2; // could've used something existing, but made a simple screen coordinate class public class Pos { public int X { get; set; } public int Y { get; set; } public Pos(int x, int y) { X = x; Y = y; } } // these make it easy (for the human) to know what each cell contains enum FieldVals { DontDraw, Empty, SnakeHead, SnakeBody, SnakeFood } // these make it easy (for the human) to read snake the direction enum SnakeDirs { Up, Right, Down, Left } static void Main(string[] args) { _rnd = new Random(); Console.Clear(); // create the initial snake cell coords (place it on playfield) SetUpSnake(); // start with an initial piece of food MakeNewFood(); // draw the border, once DrawBorder(); // game loop; this was the easiest but might switch to Timer, etc. // function names should explain purpose for (;/* ever */;) { AdjustGameSpeed(); CheckForKeyboardCommand(); UpdatePlayfield(); CheckForSnakeOutOfBounds(); CheckForSnakeCollisionWithSelf(); UpdateSnakeBodyPosition(); CheckSnakeHasEatenFood(); } } private static void CheckForSnakeCollisionWithSelf() { if( _snakeCells.Skip(1).Any(pos => pos.X == _snakeCells.First().X && pos.Y == _snakeCells.First().Y)) { EndGame(false); } } /// <summary> /// Work out the initial coordinates of the snake's body parts /// </summary> private static void SetUpSnake() { // create the empty snake array cells for (var i = 0; i < _snakeCells.Length; i++) { _snakeCells[i] = new Pos(0, 0); } // randomly choose snake's initial direction _snakeDir = (SnakeDirs)_rnd.Next((int)SnakeDirs.Up, (int)SnakeDirs.Left + 1); int[] xOffsets = { 0, _snakeBodyLen * -1, 0, _snakeBodyLen}; int[] yOffsets = { _snakeBodyLen, 0, _snakeBodyLen * -1, 0}; int xOffset = xOffsets[(int) _snakeDir]; int yOffset = yOffsets[(int) _snakeDir]; // First randomly choose the position of the snake's head // We'll work out the rest of the snake body coords based on which // direction it's initially facing. _snakeCells.First().X = _rnd.Next( xOffset * _snakeBodyLen * -1, PlayfieldWidth + xOffset * _snakeBodyLen + 1); _snakeCells.First().Y = _rnd.Next( yOffset * _snakeBodyLen * -1, PlayfieldHeight + yOffset * _snakeBodyLen + 1); switch (_snakeDir) { case SnakeDirs.Up: // make the snake's body go below the head, as it's moving up for (int i = 1; i < _snakeBodyLen; i++) { _snakeCells[i].X = _snakeCells.First().X; _snakeCells[i].Y = _snakeCells[i - 1].Y + 1; } break; case SnakeDirs.Right: // make the snake's body go left of the head, as it's moving right for (int i = 1; i < _snakeBodyLen; i++) { _snakeCells[i].X = _snakeCells.First().X - 1; _snakeCells[i].Y = _snakeCells.First().Y; } break; case SnakeDirs.Down: // make the snake's body go above of the head, as it's moving down for (int i = 1; i < _snakeBodyLen; i++) { _snakeCells[i].X = _snakeCells.First().X; _snakeCells[i].Y = _snakeCells[i - 1].Y - 1; } break; case SnakeDirs.Left: // make the snake's body go right of the head, as it's moving left for (int i = 1; i < _snakeBodyLen; i++) { _snakeCells[i].X = _snakeCells.First().X + 1; _snakeCells[i].Y = _snakeCells.First().Y; } break; } } private static void AdjustGameSpeed() { // delay so the game isn't too fast. Halve the delay (to go faster) when going left or right // as it appears that going up/down is faster Task.Delay( _snakeDir == SnakeDirs.Up || _snakeDir == SnakeDirs.Right ? MillisecondsTimeout / 2 : MillisecondsTimeout).Wait(); } /// <summary> /// Check the keyboard for arrow keys /// I got the code off the net (see bottom of code); no point re-creating this /// </summary> private static void CheckForKeyboardCommand() { if (NativeKeyboard.IsKeyDown(KeyCode.Down)) // player hit Down arrow { // can't hit down while going up; game over if (_snakeDir == SnakeDirs.Up) EndGame(false); // change snake direction to down _snakeDir = SnakeDirs.Down; } else if (NativeKeyboard.IsKeyDown(KeyCode.Up)) { // can't hit up while going down; game over if (_snakeDir == SnakeDirs.Down) EndGame(false); // change snake direction to up _snakeDir = SnakeDirs.Up; } else if (NativeKeyboard.IsKeyDown(KeyCode.Left)) { // can't hit left while going right; game over if (_snakeDir == SnakeDirs.Right) EndGame(false); // change snake direction to left _snakeDir = SnakeDirs.Left; } else if (NativeKeyboard.IsKeyDown(KeyCode.Right)) { // can't hit right while going left; game over if (_snakeDir == SnakeDirs.Left) EndGame(false); // change snake direction to right _snakeDir = SnakeDirs.Right; } } /// <summary> /// See if snake has eaten the food /// </summary> private static void CheckSnakeHasEatenFood() { // if snake head is in the same x,y position as the food // NB: First() is a Linq function; it gives me the first element in the array if (_snakeCells.First().X == FoodPos.X && _snakeCells.First().Y == FoodPos.Y) { IncrementScore(); MakeNewFood(); IncreaseSnakeSize(); } } private static void IncreaseSnakeSize() { if (_snakeBodyLen + SnakeSizeIncrease < _maxSnakeLen) { _snakeBodyLen += SnakeSizeIncrease; UpdateScore(); } } private static void UpdateScore() { WriteAt($"Score: {_score} Snake Size: {_snakeBodyLen}", 0, 0); } private static void IncrementScore() { ++_score; UpdateScore(); } /// <summary> /// Put food item at random location /// </summary> private static void MakeNewFood() { int x, y; do { // this ensures we're not putting the food on top of the snake, or the border x = _rnd.Next(1, PlayfieldWidth - 1); y = _rnd.Next(1, PlayfieldHeight - 1); } while (_snakeCells.Any(pos => pos.X == x || pos.Y == y)); // set the food coords FoodPos.X = x; FoodPos.Y = y; // update the playfield position with the food value PlayField[FoodPos.X, FoodPos.Y] = FieldVals.SnakeFood; } static void CheckForSnakeOutOfBounds() { // snake mustn't be on any border cell, or game over if (_snakeCells.First().Y < 1 || _snakeCells.First().X > PlayfieldWidth - 2 ||_snakeCells.First().Y > PlayfieldHeight - 2 || _snakeCells.First().X < 1) { EndGame(false); } } /// <summary> /// Move the snake pieces appropriately. I just did the simplest thing that I thought of. /// </summary> static void UpdateSnakeBodyPosition() { // remember the position of the snake's last piece so that later, // after drawing the snake, we can set it to the 'don't draw' value EraserPos.X = _snakeCells[_snakeBodyLen].X; EraserPos.Y = _snakeCells[_snakeBodyLen].Y; // Last piece of snake's tail will always become empty as the snake moves // NB: Last() is a Linq function; it gives me the last element in the array (end of snake tail) PlayField[_snakeCells[_snakeBodyLen].X, _snakeCells[_snakeBodyLen].Y] = FieldVals.Empty; // move the 'middle' section of the snake one cell along for (int i = _snakeCells.Length - 1; i > 0; i--) { _snakeCells[i].X = _snakeCells[i - 1].X; _snakeCells[i].Y = _snakeCells[i - 1].Y; } // move the snake's head, depending on direction moving // the body was already moved above switch (_snakeDir) { case SnakeDirs.Up: // moved the snake head up 1 (-ve Y direction) --_snakeCells.First().Y; break; case SnakeDirs.Right: // moved the snake head right 1 (+ve X direction) ++_snakeCells.First().X; break; case SnakeDirs.Down: // moved the snake head up 1 (+ve Y direction) ++_snakeCells.First().Y; break; case SnakeDirs.Left: // moved the snake head left 1 (-ve X direction) --_snakeCells.First().X; break; } // Set the playfield position at the head of the snake, to be... the snake head! PlayField[_snakeCells.First().X, _snakeCells.First().Y] = FieldVals.SnakeHead; // Set the positions on the playfield for the snake body cells // so we know to draw them // NB: Skip(1).Take(4) is Linq; it gives me the array left after // skipping the first item, then grabbing the next 4 (so in this // case misses the first and last). foreach (var cell in _snakeCells.Skip(1).Take(4)) { PlayField[cell.X, cell.Y] = FieldVals.SnakeBody; } } /// <summary> /// Just show a message and exit (can only lose right now) /// </summary> /// <param name="win"></param> static void EndGame(bool win) { Console.Clear(); Console.WriteLine($"YOU DIED. Score: {_score} Snake Length: {_snakeBodyLen}"); Console.ReadKey(); Console.ReadKey(); Environment.Exit(0); } /// <summary> /// Set the console size appropriately & draw the border, leaving room for the score /// </summary> static void DrawBorder() { Console.SetWindowSize(PlayfieldWidth, PlayfieldHeight + 2); WriteAt("╔", 0, 1); WriteAt("╗", PlayfieldWidth - 1, 1); WriteAt("╚", 0, PlayfieldHeight); WriteAt("╝", PlayfieldWidth - 1, PlayfieldHeight); for (var i = 1; i < PlayfieldWidth - 1; i++) { WriteAt("═", i, 1); WriteAt("═", i, PlayfieldHeight); } for (var i = 2; i < PlayfieldHeight; i++) { WriteAt("║", 0, i); WriteAt("║", PlayfieldWidth - 1, i); } } /// <summary> /// Go through every element of the 2d array, only drawing a cell /// if it has a value (other than 0). This way we only draw the /// cells that need to be updated. A bit like Invalidate() in GDO. /// Pretty self-explanatory; if a cell has a value, draw the character /// appropriate for it. The space is only used to overwrite the last /// piece of the snake's tail. /// </summary> static void UpdatePlayfield() { var cellsDrawn = 0; for (var i = 1; i < PlayfieldWidth - 1; i++) { for (var j = 1; j < PlayfieldHeight - 1; j++) { switch (PlayField[i, j]) { case FieldVals.Empty: WriteAt( EmptyCell, i, j + 1); break; case FieldVals.SnakeHead: WriteAt(SnakeHeadCell, i, j + 1); break; case FieldVals.SnakeBody: WriteAt(SnakeBodyCell, i, j + 1); break; case FieldVals.SnakeFood: WriteAt(FoodCell, i, j + 1); PlayField[FoodPos.X, FoodPos.Y] = FieldVals.DontDraw; break; } ++cellsDrawn; } } Debug.Assert( cellsDrawn <= _snakeBodyLen + 3); // Debug.WriteLine($"Cells drawn: {cellsDrawn}"); PlayField[EraserPos.X, EraserPos.Y] = FieldVals.DontDraw; } // From Microsoft sample protected static void WriteAt(string s, int x, int y) { try { Console.SetCursorPosition(x, y); Console.Write(s); } catch (ArgumentOutOfRangeException e) { Console.Clear(); Console.WriteLine(e.Message); } } } /// <summary> /// Codes representing keyboard keys. /// </summary> /// <remarks> /// Key code documentation: /// http://msdn.microsoft.com/en-us/library/dd375731%28v=VS.85%29.aspx /// </remarks> internal enum KeyCode { Left = 0x25, Up, Right, Down } /// <summary> /// Provides keyboard access. /// </summary> internal static class NativeKeyboard { /// <summary> /// A positional bit flag indicating the part of a key state denoting /// key pressed. /// </summary> const int KeyPressed = 0x8000; /// <summary> /// Returns a value indicating if a given key is pressed. /// </summary> /// <param name="key">The key to check.</param> /// <returns> /// <c>true</c> if the key is pressed, otherwise <c>false</c>. /// </returns> public static bool IsKeyDown(KeyCode key) { return (GetKeyState((int)key) & KeyPressed) != 0; } /// <summary> /// Gets the key state of a key. /// </summary> /// <param name="key">Virtual-key code for key.</param> /// <returns>The state of the key.</returns> [System.Runtime.InteropServices.DllImport("user32.dll")] static extern short GetKeyState(int key); } } Can't seem to put text above the code. Anyway, this is playable except you sometimes die immediately. Need to tweak the snake placement code. Metro Exodus has downloaded, so off to play that Have fun
    46. jbarrios

      Where are we now (DEMO)

      Hey badramgad, I had to a chance to play your demo and I recorded it: https://www.youtube.com/watch?v=fffgK5pGbrc&feature=youtu.be - I like the mystery that is set up of who the player character is and what's going on with the world - I like the music - The writing is good - My laptop didn't like holding the inventory key and using the mouse at the same time. I would have rather had the inventory be a toggle - I had a hard time selecting items, but that may have been my strange laptop. - I wasn't able to solve the TV puzzle. - When I walked into the edge of the island I got a jumpy collision effect. Overall I like it. I would have liked to keep playing, but I got stuck. Probably because I'm dumb. I'm excited to see how this turns out.
    47. Wysardry

      A Low requeriments Engine?

      AppGameKit should run okay on your system.
    48. Rutin

      A Low requeriments Engine?

      What operating system are you using? What graphics card do you have? Do you have any programming experience? If not are you willing to learn to code?
    49. invent71

      IRIDIUM

      Album for IRIDIUM
    50. phil67rpg

      c# console snake game

      well I am making a graphics c# program. can you give me just a hint as how to make the snake smooth animation.
    51. Touchmybow

      How to avoid open-world grind?

      I heartily disagree, as with this method you eliminate the need for the player to think for himself because you provide everything he needs on his way to the main goal. You want the player to use his wits and knowledge of the game and seek out what he wants to gather. And secondly, it's also a form of player choice. Should I get X or Y? And how much should I get? Third, the activity itself loses its identity since it just becomes part of the conglomerate of the main path. I can't know if its the realism that makes it feel grindy, but anyone can tell you that some realism kills fun factor. What I can tell you is if it does feel grindy, its because the activity (or activies) is no longer producing a positive experience. You need to add meaning to the activity or clean up the activity itself so that it flows pleasantly. You can add meaning in several ways. Make the player feel like he's partaking in a cool, interesting activity. That's the role playing aspect of the activity; make the context interesting and engaging. Another way to add meaning to the activity is to tweak the rewards of the activity, which is the bigger context, such as the gains in stats, the material rewards, the progression towards completing the game, and any other type of progression. I may be missing some forms of meaning, but this is just what I can think of atm. The point is that if the player is enjoying the activity, it won't feel like a grind because he won't be thinking about it as work, but as play. The other thing I mentioned was cleaning up the activity so that its a pleasant activity without hick ups, annoyances, or tedious snags that bring down the level of enjoyment, which leads to the feeling of grind. So grind isn't just repetition. It's work without play, which is found in repetition, yes, but repetition can be enjoyable and not feel like a grind. Finally, you mentioned the open world, nonlinear progression as possibly a problem making the game into a grind, but its not clear to me how so and you'd need to elaborate. My only guess is you're afraid you're overwhelming the player with too many activities and giving him a lack of a feeling of completion? I don't know what you're asking.
    52. Hello, I have an idea for a game: It would be just like a traditional Real-Time Strategy game, but with a twist: the user is given the ability to write AI for their units. There would be a a development mode of the game where you could access basic unit functionality (like move here, move there, attack, etc.), and basic information (like type and position of enemy units you have detected), and write your own AI. I think this would be really cool , both for people who already know how to code, and for people just starting to learn. It occurs to me that it would be waaaay easier for me to modify an existing open source game to add this functionality than it would be for me to write my own RTS game from stratch. Like probably the difference between me being able to do it and not (I am doing this on the side of my day job). However, I think it would be cool to at least try to make money from this game. So I was looking into licensing, and it looks like almost all open source games are released under the GNU GPL license, meaning that they are legal to modify and redistribute, even for money, provided that the mod is also released under GNU GPL, and provides the source code. This makes sense, but it of course makes it difficult to make money selling a game, because anyone who buys it can then redistribute it for free if they choose. I also read about the GNU Limited GPL (LGPL), which looks like closer to what I want--open source stuff that can be included in proprietary works. You don't have to provide the source code for your modification. It looks like you have to clearly separate your work from the LGPL work by using them as dynamically linked libraries, or something like that. I'm not sure how technologically viable that is for my idea yet. I tried to find RTS games made with this license. I might have found one (Evolution RTS: https://github.com/EvolutionRTS/Evolution-RTS/blob/master/license.txt), but it's ambiguous, and I'm unsure. Generally though, it seems like LGPL might be more of a thing for tools like game engines rather than whole games. One idea I have is to modify a regular GPL game, then host it with servers for competitive play on some site like steam. I of course wouldn't advertise that the code is open source, but people would probably be able to get the game itself for free in this way if they looked into it. However, they wouldn't be able to play it competitively against other people without paying on steam. Any advice? I'd be happy to hear feedback on the legal issue and/or the idea in general. Thanks!
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!