1. Past hour
2. ## what are capabilities and limitations of unreal engine blueprint

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. ## what are capabilities and limitations of unreal engine blueprint

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. ## DungeonBot3000: The Dungeon Crawl Challenge

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. ## undefined behavior of bullet objects.

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. ## 101. Socket.io Connection, JS/ES5

Next part: Emit and Broadcast JSON
8. ## 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. ## Appropriate questions to ask in interview

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. ## Emit and Broadcast JSON

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. ## DX11 pixel shader self calculated depth value is not correctly witten in depth buffer

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. ## Question about making meshes for spritesheets

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. ## (Video inside) Weird transparency issue with procedurally generated mesh

Does it work if you turn off blending?
14. ## Humanitarian Gamification: Designing a game to save the world?

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 ^^

16. ## Checking a Height Value Repeatedly

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. ## (Video inside) Weird transparency issue with procedurally generated mesh

It seems you are dependant on the order of the triangles processed/drawn
18. ## Humanitarian Gamification: Designing a game to save the world?

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

20. ## Implementing realistic DOF like in GTA V

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. ## 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. ## 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. ## (Video inside) Weird transparency issue with procedurally generated mesh

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. ## 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. ## 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. ## Can I make Websocket multiplayer games for any genre?

Thanks for the answer Hodgman! I'll take a look at the link.
27. ## Psy - Dungeon Challenge

Amazing retro aesthetics. Loved it. I will try it out as soon as I can. Cheers, r1ckparker,

29. ## (Video inside) Weird transparency issue with procedurally generated mesh

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. ## 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. ## (Video inside) Weird transparency issue with procedurally generated mesh

Would posting more code help?
32. ## DungeonBot3000: The Dungeon Crawl Challenge

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!

34. ## 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. ## Appropriate questions to ask in interview

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. ## 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. ## Can I make Websocket multiplayer games for any genre?

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. ## Can I make Websocket multiplayer games for any genre?

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. ## Question about making meshes for spritesheets

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. ## Appropriate questions to ask in interview

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.

42. ## 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. ## 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. ## 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. ## 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. ## 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. ## A Low requeriments Engine?

AppGameKit should run okay on your system.
48. ## 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. ## IRIDIUM

Album for IRIDIUM
50. ## 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. ## 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. ## Options/Advice for Selling Mod on Open-Source Game?

• 0
• 0
• 0

• ### GameDev Challenges

Open Group  ·  86 members

• ### For Beginners

Public Group  ·  1 member

• ### Unreal Engine Users

Open Group  ·  4 members

• ### Optimization Strategy

Open Group  ·  1 member

• ### Publishing and Monetization

Open Group  ·  1 member

1. 1
Rutin
26
2. 2
3. 3
4. 4
5. 5

• ### Member Statistics

• Total Members
253946
• Most Online
6110