• Advertisement

Search the Community

Showing results for tags 'Javascript'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • News

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • GameDev Unboxed

Categories

  • Game Dev Loadout

Categories

  • Game Developers Conference
    • GDC 2017

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Critique and Feedback
  • Topical
    • Virtual and Augmented Reality
    • News
  • Community
    • GameDev Challenges
    • For Beginners
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams

Blogs

There are no results to display.

There are no results to display.

Marker Groups

  • Members

Developers

Developers


Group


About Me


Website


Industry Role


Twitter


Github


Twitch


Steam

Found 36 results

  1. More Adventures in Robust Coding

    Hello GameDev, This entry is going to be a big one for me, and it's going to cover a lot. What I plan to cover on my recent development journey is the following: 1 - Goal of this Blog entry. 2 - Lessons learned using Node.js for development and testing as opposed to Chrome console. 3 - Linear Path algorithm for any surface. 4 - Dynamic Path Finding using Nodes for any surface, incorporating user created, dynamic assets. 5 - short term goals for the game. -- - -- - -- - -- - -- - -- - Goal of this Blog entry - -- - -- - -- - -- - -- - -- My goal for this adventure is to create a dynamic path-finding algorithm so that: - any AI that is to be moved will be able to compute the shortest path from any two points on the surface of the globe. - the AI will navigate around bodies of water, vegetation, dynamic user assets such as buildings and walls. - will compute path in less then 250 milliseconds. There are a few restrictions the AI will have to follow, in the image above you can see land masses that are cut off from one another via rivers and bodies of water are uniquely colored. If an AI is on a land mass of one color, for now, it will only be able to move to a location on the same colored land mass. However; there are some land masses that take up around 50% of the globe and have very intricate river systems. So the intended goal is be able to have an AI be on one end of the larger land mass and find the shortest path to the opposite end within 250 milliseconds. Currently my path finding algorithm can find the shortest path in anywhere from 10 ms and up, and when I say up, I mean upwards of 30 seconds, and that's because of the way I built the algorithm, which is in the process of being optimised. -- - -- - -- - -- - -- - -- - Lessons learned using Node.js for development and testing - -- - -- - -- - -- - -- - -- As of this writing I am using Node.js to test the efficiency of my algorithms. This has slowed down my development. I am not a programmer by trade, I've taught myself the bulk-work of what I know, and I often spend my time re-inventing the wheel and learning things the hard way. Last year I made the decision to move my project over to Node.js for continued development, eventually it all had to be ported over to Node.js anyways. In hind sight I would have done things differently. I would have continued to use Chrome console for testing and development, small scale, then after the code was proven to be robust would I then port it over to Node.js. If there is one lesson I'd like to pass on to aspiring and new programmers, it's this, use a language and development environment that allows you, the programmer, to jump into the code while it's running and follow each iteration, line by line, of code as it's be executed, basically debugging. It is so easy to catch errors in logic that way. Right now I'm throwing darts at a dart board, guesses what I should be sending to the console for feedback to help me learn more about logical errors using Node.js, see learning the hard way. -- - -- - -- - -- - -- - -- - Linear Path algorithm for any surface. - -- - -- - -- - -- - -- - -- In the blog entry above I go into detail explaining how I create a world. The important thing to take away from it is that every face of the world has information about all surrounding faces sharing vertices pairs. In addition, all vertices have information regarding those faces that use it for their draw order, and all vertices have information regarding all vertices that are adjacent to them. An example vertices and face object would look like the following: Vertices[ 566 ] = { ID: 566, x: -9.101827364, y: 6.112948791, z: 0.192387718, connectedFaceIDs: [ 90 , 93 , 94 , 1014 , 1015 , 1016 ], // clockwise order adjacentVertices: [ 64 , 65 , 567 , 568 , 299 , 298 ] // clockwise order } Face[ 0 ] = { ID: 0, a: 0, b: 14150, c: 14149, sharedEdgeVertices: [ { a:14150 , b: 14149 } , { a:0 , b: 14150 } , { a:14149 , b:0 } ], // named 'cv' in previous blog post sharedEdgeFaceIDs: [ 1 , 645 , 646 ], // named 's' in previous blog post drawOrder: [ 1 , 0 , 2 ], // named 'l' in previous blog post } Turns out the algorithm is speedy for generating shapes of large sizes. My buddy who is a Solutions Architect told me I'm a one trick pony, HA! Anyways, this algorithm comes in handy because now if I want to identify a linear path along all faces of a surface, marked as a white line in the picture above, you can reduce the number of faces to be tested, during raycasting, to the number of faces the path travels across * 2. To illustrate, imagine taking a triangular pizza slice which is made of two faces, back to back. the tip of the pizza slice is touching the center of the shape you want to find a linear path along, the two outer points of the slice are protruding out from the surface of the shape some distance so as to entirely clear the shape. When I select my starting and ending points for the linear path I also retrieve the face information those points fall on, respectively. Then I raycaste between the sharedEdgeVertices, targeting the pizza slice. If say a hit happens along the sharedEdgeVertices[ 2 ], then I know the next face to test for the subsequent raycaste is face ID 646, I also know that since the pizza slice comes in at sharedEdgeVertice[ 2 ], that is it's most likely going out at sharedEdgeVertices[ 1 ] or [ 0 ]. If not [ 1 ] then I know it's 99% likely going to be [ 0 ] and visa-versa. Being able to identify a linear path along any surface was the subject of my first Adventure in Robust Coding. Of course there are exceptions that need to be accounted for. Such as, when the pizza slice straddles the edge of a face, or when the pizza slice exits a face at a vertices. Sometimes though when I'm dealing with distances along the surface of a given shape where the pizza slice needs to be made up of more than one set of back to back faces, another problem can arise: I learned about the limitations of floating point numbers too, or at least that's what it appear to be to me. I'm sure most of you are familiar with some variation of the infinite chocolate bar puzzle So with floating point numbers I learned that you can have two faces share two vertices along one edge, raycaste at a point that is directly between the edges of two connecting faces, and occasionally, the raycaste will miss hitting either of the two faces. I attribute this in large part because floating point numbers only capture an approximation of a point, not the exact point. Much like in the infinite chocolate bar puzzle there exists a tiny gap along the slice equal in size to the removed piece, like wise, that tiny gap sometimes causes a miss for the raycaste. If someone else understands this better please correct me. -- - -- - -- - -- - -- - -- - Dynamic Path Finding using Nodes for any surface - -- - -- - -- - -- - -- - -- Now that I've got the linear path algorithm working in tip top shape, I use it in conjunction with Nodes to create the pathfinding algorithm. Firstly I identify the locations for all nodes. I do this using a Class I created called Orientation Vector, I mention them in the blog post above. When they're created, they have a position vector, a pointTo vector, and an axis vector. The beauty of this class is that I can merge them, which averages their position, pointTo, and axis vectors, and it allows me to rotate them along any axis, and it allows me to move them any distance along the axis of their pointTo vector. To create shoreline collision geometry, and node collision geometry, illustrated above, and node locations along shorelines, illustrated below, I utilise the Orientation Vector Class. Firstly, the water table for the world is set to an arbitrary value, right now it's 1.08, so if a vector for a given face falls below the table and one or two vertors are above the table then I know the face is a shoreline face. Then I use simple Math to determine at what two points the face meets the water and create two OVectors, each pointing at each-other. Then I rotate them along their y axis 90 and -90 degrees respectively so that they are now facing inland. Since each face, which are shoreline faces, touch one another, there will be duplicate OVectors a each point along the shore. However, each Ovector will have a pointTo vector relative to it's sister Ovector during creation. I merge the paired Ovectors at each point along the shore, this averages their position, pointTo and axis. I then move them inland a small distance. The result is the blue arrows above. The blue arrows are the locations of three of the thousands of nodes created for a given world. Each Node has information about the shoreline collision geometry, the node collision geometry ( the geometry connecting nodes ), and the Node to its left and the Node to its right. Each face of collision geometry is given a Node ID to refer to. So to create the path-finding algorithm. I first identify the linear path between the starting and ending points. I then test each segment of the linear path for collision geometry. If I get a hit, I retrieve the Node ID. This gives me the location for the Node associated for a given face of collision geometry. I then travel left and right along connecting Nodes checking to see if a new Linear path to the end point is possible, if no immediate collision geometry is encountered, the process continues and is repeated as needed. Subsequently, a list of points is established, marking the beginning, encountered Nodes and end of the line of travel. The List is then trimmed by testing linear paths between every third point, if a valid path is found, the middle point is spliced. Then all possible paths that have been trimmed are calculated for distance. the shortest one wins. Below is the code for the algorithm I currently use. its my first attempt at using classes to create an algorithm. Previously I just relied on elaborate arrays. I plan on improving the the process mentioned above by keeping track of distance as each path spreads out from it's starting location. Only the path which is shortest in distance will go through its next iteration. With this method, once a path to the end is found, I can bet it will be shortest, so I won't need to compute all possible paths like I am now. The challenge I've been facing for the past two months is sometimes the Nodes end up in the water, The picture above shows a shoreline where the distance the OVectors travel would place them in the water. Once a node is in the water, it allows the AI to move to it, then there is no shoreline collision geometry for it to encounter, which would keep it on land, and so the AI just walks into the ocean. Big Booo! I've been writing variations of the same function to correct the location of the geometry shown below in Red and Yellow below. But what a long process. I've rewritten this function time and time again. I want it to be, well as the title of this Blog states, Robust, but it's slow going. As of today's date, it's not Robust, and the optimised path-finding algorithm hasn't been written either. I'll be posting updates in this blog entry as I make progress towards my goal. I'll also make mention what I achieve for shortest, long time for pathfinding. Hopefully it'll be below 250 ms. -- - -- - -- - -- - -- - -- - short term goals for the game - -- - -- - -- - -- - -- - -- Badly... SO BADLY I want to be focusing on game content, that's all I've been thinking about. Argh, But this all has to get wrapped up before I can. I got ahead of myself, I'm guilty of being too eager. But there is no sense building game content on top of an engine which is prone to errors. My immediate goals for the engine are as follows: // TO DO's // // Dec 26th 2017 // /* * << IN PROGRESS >> -update path node geometry so no errors occur * -improve path finding alg with new technique * -improve client AI display -only one geometry for high detail, and one for tetrahedron. * -create ability to select many AI at the same time by drawing a rectangle by holding mouse button. * -create animation server to recieve a path and process animation, and test out in client with updates. * -re-write geometry merging function so that the client vertices and faces have a connected Target ID * -incorporate dynamic asset functionality into client. * -create a farm and begin writing AI. * -program model clusters * -sychronize server and client AI. Test how many AI and how quickly AI can be updated. Determine rough estimate of number of players the server can support. * */ see the third last one! That's the one, oh what a special day that'll be. I've created a Project page, please check it out. It gives my best description to date of what the game is going to be about. Originally I was going to name it 'Seed', a family member made the logo I use as my avatar and came up with the name back in 2014. Then just this week I find out that some studio in Europe is making THE EXACT SAME GAME ! WHA??? http://www.pcgamer.com/seed-is-a-hugely-ambitious-in-development-mmo-that-echoes-eve-online-rimworld-and-the-sims/ I'm being facetious, but they're very close to being the same game. Anyways, Mine will be better, you read it here first! hahaha. The project is no longer going to be called Seed, it's instead going to be called what I've always called it and will probably always call it; the game [ edit: 02/02/18 Some new screen shots to show off. All the new models were created by Brandross. There are now three earth materials, clay, stone and marble. There are also many types of animals and more tree types. ] Thanks for reading and if you've got anything to comment on I welcome it all. Awoken
  2. Missile Command

    Here goes my game. This challenge is sooooo convenient to me for I have no ability of drawing... :( By finishing it I learned lots of Cocos Creator, which is good at UI effects. Thanks a lot for the Challenge! Download (Windows only): https://www.dropbox.com/s/q0l37r5urhqgtup/MissileCommandRelease.zip?dl=0 Source code: https://github.com/surevision/Missile_Command_Challenge Screenshot:
  3. We're looking for programmers for our project. Our project is being made in Unity Requirements: -Skills in Unity -C# -Javascript -Node.js We're looking for programmers who can perform a variety of functions on our project. Project is a top-down hack-and-slash pvp dungeon-crawler like game. Game is entirely multiplayer based, using randomized dungeons, and a unique combat system with emphasis on gameplay. We have a GDD to work off of, and a Lead Programmer you would work under. Assignments may include: -Creating new scripts of varying degrees specific to the project (mostly server-side, but sometimes client-side) -Assembling already created monsters/characters with existing or non-existing code. -Creating VFX -Assembling already created environment models If interested, please contact: eldwin11929@yahoo.com This project is unpaid, but with royalties. --- Additional Project Info: Summary: Bassetune Reapers is a Player-verus-Player, competitive dungeon crawler. This basically takes on aspects of dungeon crawling, but with a more aggressive setting. Players will have the option to play as the "dungeon-crawlers" (called the 'Knights', or "Knight Class", in-game) or as the "dungeon" itself (literally called the 'Bosses', or "Boss Class", in-game). What this means is that players can choose to play as the people invading the dungeon, or as the dungeon-holders themselves. Key Features: -Intense, fast-paced combat -Multiple skills, weapons, and ways to play the game -Tons of different Bosses, Minibosses, creatures and traps to utilize throughout the dungeon -Multiple unique environments -Interesting, detailed lore behind both the game and world -Intricate RPG system -Ladder and ranking system -Lots of customization for both classes s of customization for both classes
  4. I want to make a html5 canvas / javascript game, similar to agar.io. I know a little node.js, and I think I understand the way online multiplayer works, but now that I do understand I realize it's gonna be a ton of work if I want to do it from the ground up with something like socket.io. My question is: are there libraries that can help with the multiplayer aspects of my game (sending game packets, etc.), and if so, is the performance for that library fast enough to run my game? (has a latency at least as low as agar.io)
  5. NeutrinoParticles is a Real-time Particles Effect Editor and it is a new extraordinary editor on the market.www.neutrinoparticles.com What makes this editor recognisably different than other editors is, it allows you to export the effects to the source code in JavaScript or C# which makes them extremely compact and fast, and it is absolutely FREE. MacOS and Linux users may use WINE to run the editor for now. Native packages will be available soon. Particles Effect Editor, JavaScript, C#, Unity, PIXI Engine, Generic HTML The software has some renderers for JavaScript (PIXI Engine, Generic HTML) and for C# (Unity, C# Generic). For example, if you use PIXI on your projects, you only need to copy/paste several lines of code to make it work.
  6. We're looking for programmers for our project. Our project is being made in Unity Requirements: -Skills in Unity -C# -Javascript -Node.js We're looking for programmers who can perform a variety of functions on our project. Project is a top-down hack-and-slash pvp dungeon-crawler like game. Game is entirely multiplayer based, using randomized dungeons, and a unique combat system with emphasis on gameplay. We have a GDD to work off of, and a Lead Programmer you would work under. Assignments may include: -Creating new scripts of varying degrees specific to the project (mostly server-side, but sometimes client-side) -Assembling already created monsters/characters with existing or non-existing code. -Creating VFX -Assembling already created environment models If interested, please contact lead developer on skype: statichs This project is unpaid, but with royalties. Or if you don't have skype, please email: eldwin11929@yahoo.com (but contacting via skype is preferred over email) --- Additional Project Info: Summary: Bassetune Reapers is a Player-verus-Player, competitive dungeon crawler. This basically takes on aspects of dungeon crawling, but with a more aggressive setting. Players will have the option to play as the "dungeon-crawlers" (called the 'Knights', or "Knight Class", in-game) or as the "dungeon" itself (literally called the 'Bosses', or "Boss Class", in-game). What this means is that players can choose to play as the people invading the dungeon, or as the dungeon-holders themselves. Key Features: -Intense, fast-paced combat -Multiple skills, weapons, and ways to play the game -Tons of different Bosses, Minibosses, creatures and traps to utilize throughout the dungeon -Multiple unique environments -Interesting, detailed lore behind both the game and world -Intricate RPG system -Ladder and ranking system -Lots of customization for both classes s of customization for both classes
  7. In part 1, I wrote about a difficulty endemic to just about any porting project, the importing and trans-coding of data to different formats. Here in part 2 I'll cover a few of the trickier engine architectural differences that exist between the original engine for Static:IT (Selenite) and the new engine that will support it (base-code from 96Mill and Revel Immortal) Different Origins Originally designed to support editor-only development of Adventure and RPG games, Selenite was a successor of the S3Engine (The Lost City of Malathedra); and shared many simularities with the primary exception being that S3 was designed such that scripts and associated resources were to be written in external tools, and the S3Engine was a pre-compiled exe run-time, that read and executed the scripts and resources. Selenite on the other hand, was an IDE, where game objects were added via a tree-view interface, along with resources; and the IDE was responsible for processing and packaging these resources for optimal end-use. The resulting resources were likewise run next to a pre-compiled SeleniteWin32.exe There is a relatively large expanse of time between the creation of Selenite in 2009, and the creation of Engine4 (or EngineIV ...it's not really important) in 2013; E4 represents several massive shifts in the way I build engines at least as of the time of this writing. It's in HTML5/JS, runs in the browser, and is 'wrapped' for platforms/services that only except exe, etc. It's heavily designed around The Trinity Pattern which is a design pattern I developed to aid in making a game expandable, without breaking save-games, or amassing technical-debt with each release. Dependency Injection and Law of Demeter are used heavily to reduce coupling It's a series of engines, where for each new game we clone the engine code of a game most like it; and features are selectively merged backwards if they're desired. Each game's run-time is optimized to that game, without regard for other games. This is to avoid having to square new features or feature modifications/removals against existing games. The Problems It became clear early in the port, that I was going to have an issue with the difference each engine handles a concept which I refer to as residency. In Selenite, there is the the Game class, which has a list of Room classes, and each of these rooms had a list of Actor classes; and when the game was loaded, that tree structure would be created and resident in memory; addressable at all times. ...not a terrible design, but one I had departed from a while ago; the primary issue is that Selenite mixes the issue of State and Runtime ...that is, objects are in charge of their runtime representation, mechanics and non-persistent state and they also hold their persistent (save game) state as well. In Engine4, the there is a separate class for a game object's persistent state, as well as its runtime. This allows an object's state to be retrieved, and passed into the construction of a newly minted runtime object. runtime objects can be created and destroyed at will, with its separate persistent state living on. This explicit separation of persistent state, as well as the tear-down and reconstruction of game objects is really helpful in allowing for game changes, additions/updates; without breaking previously saved game-state. ...however! That is really not important in the context of porting Static:IT So, the residency scheme in Engine4 (well new Static:IT's copy of it at least) needed to go, it simply wasn't worth trying to massage the wealth of code to deal with alternate mechanisms for modifying non-resident runtime state when I could bring the engine into alignment with the original needs. ...and thankfully, due to dependency injection and law of Demeter; the change was easy. Instead of creating and destroying each room, and its actors as the player traversed them, I was able to shift the code, changing mostly top-level factory functions, to create and maintain the total list of rooms and actors at start. ...in Part:3 I'll cover issues pertaining with porting the scripting from Lua to JS
  8. 'lo again all. I mentioned in my previous entry that I've been porting our 2009 release, Static: Investigator Training which is a C++/Direct3D/lua fmv horror adventure; to html5/js (canvas) using the base code from 96Mill and Revel Immortal as a starting point. The process has been going well, however there have been some sticky spots. extracting the original data from binary files atlasing approximately 300mb of png compressed graphics mimicking synchronous co-routine functions lua provided in JS differences between the original engine and the new engine re-re-remembering that everything takes way longer than you think it will I attacked what I thought would be the hardest problem first, which was extracting the original binary data. There were two forms of binary file classes.bin and game.bin; where classes.bin represented the data classes or 'templates' that described static, shared (by flyweight pattern) attributes for all three object types; game, rooms and actors. ...and where game.bin was in the exact form of a save-game, that represented a new-game initial state. That is representing the actual objects, their relationships (game has rooms, room has actors), starting attributes (position, animation, alpha, etc.) I used NodeJS to parse both of these files and export json equivalents of each file for easy access of data; I also took this opportunity to have computer assistance for renaming/transforming members to better match what the new engine would expect. Next I began to import the existing resources, which involved preparing them for a lot of atlasing Audio was simple, save for the shear amount of it; when starting a new HTML5 project; you always take size and amount of resources into consideration; it's like climbing Everest (not that I ever have) but everything you include needs to be downloaded by the user who is expecting a snappy game on their probably outdated tablet ...so you're careful. I didn't have any such luxury in the port, the final sound effect atlas came to 10 minutes; which should be fine. ...thankfully voice files are not atlased, as there is over 500 of them. In addition to atlasing, all of this data must be trans-coded as well, from source formats such as .wav, to deployment formats of .ogg and .mp3 ...why both? because depending on which device/browser/version you encounter some are only capable of running one or the other ...and some which are capable of playing both, are better at playing one than another ...and some devices outright lie. But this has gotten better over the years.
  9. Math Warriors Game

    My 1st Android game developed with React-Native and called Math Warriors

    © MathWarriorsGame

  10. surviv.io

    Hi all! Long time no post. We've been on extended hiatus from game development for several years, but came out of hiding to develop a fun little browser game. It's called surviv.io, and you can find it (appropriately) at http://surviv.io. It's strongly influenced by way too many hours spent playing PUBG. Spawn in, grab some loot, and be the last person standing. Please check it out and let us know what you think!
  11. I am currently attempting to make a navigation mesh for our 2D top down game, which is a multiplayer game using Node.js as the server communication. At the moment, I have implemented A* over an obstacle hardnessmap, which is awfully slow and laggy at times when we test our game on Heroku. I have been trying to find an algorithm to automatically generate the navmesh after map creation, instead of me having to do this manually. I am currently attempting to use Delaunay's Triangulation Divide and Conquer algorithm, but I am running into some issues. I have already asked a question on StackOverflow and am not getting many suggestions and help from it, so I figured I would come here. Is there another algorithm that might be better to use for the navmesh generation in comparison to Deluanay's Triangulation? My current implementation seems extremely buggy during the merge step and I cannot find the error. I have checked over the code countless times, comparing it to the description of the algorithm from http://www.geom.uiuc.edu/~samuelp/del_project.html. My current code is this: class MapNode { constructor(x, y) { this.position = new Vector(x, y); this.neighbors = []; } distance(n) { return this.position.distance(n.position); } inNeighbor(n) { for (let i = 0; i < this.neighbors.length; i++) { if (this.neighbors[i] === n) return true; } return false; } addNeighbor(n) { this.neighbors = this.neighbors.filter((node) => node != n); this.neighbors.push(n); } addNeighbors(arr) { let self = this; arr.forEach((n) => self.neighbors.push(n)); } removeNeighbor(n) { this.neighbors = this.neighbors.filter((neighbor) => neighbor != n); } } class Triangle { constructor(p1, p2, p3) { this.p1 = p1; this.p2 = p2; this.p3 = p3; this.neighbors = []; } addNeighbors(n) { this.neighbors.push(n); } } function genSubMat(matrix, ignoreCol) { let r = []; for (let i = 0; i < matrix.length - 1; i++) { r.push([]); for (let j = 0; j < matrix[0].length; j++) { if (j != ignoreCol) r[i].push(matrix[i + 1][j]); } } return r; } function determinantSqMat(matrix) { if (matrix.length != matrix[0].length) return false; if (matrix.length === 2) return matrix[0][0] * matrix[1][1] - matrix[1][0] * matrix[0][1]; let det = 0; for (let i = 0; i < matrix.length; i++) { let r = genSubMat(matrix, i); let tmp = matrix[0][i] * determinantSqMat(r); if (i % 2 == 0) det += tmp; else det -= tmp; } return -det; } // if d is in the circle formed by points a, b, and c, return > 0 // d is on circle, return 0 // d is outside of circle, return < 0 function inCircle(a, b, c, d) { let arr = [a, b, c, d]; let mat = [ [], [], [], [] ]; for (let i = 0; i < arr.length; i++) { mat[i][0] = 1; mat[i][1] = arr[i].position.x; mat[i][2] = arr[i].position.y; mat[i][3] = arr[i].position.x * arr[i].position.x + arr[i].position.y * arr[i].position.y; } return determinantSqMat(mat); } function walkable(from, to, hardnessMap) { let diff = new Vector(to.x - from.x, to.y - from.y); if (Math.abs(diff.x) > Math.abs(diff.y)) diff.scale(Math.abs(1 / diff.x)); else diff.scale(Math.abs(1 / diff.y)); let current = new Vector(from.x + diff.x, from.y + diff.y); while (Math.round(current.x) != to.x || Math.round(current.y) != to.y) { if (hardnessMap[Math.floor(current.y)][Math.floor(current.x)] === 1) return false; current.x += diff.x; current.y += diff.y; } return true; } function getLowest(nodes) { let lowest = nodes[0]; for (let i = 1; i < nodes.length; i++) { if (nodes[i].position.y < lowest.position.y) lowest = nodes[i]; } return lowest; } // returns the angle between 2 vectors, if cw is true, then return clockwise angle between, // else return the ccw angle between. b is the "hinge" point function angleBetween(a, b, c, cw) { let ba = new Vector(a.position.x - b.position.x, a.position.y - b.position.y); let bc = new Vector(c.position.x - b.position.x, c.position.y - b.position.y); let v0 = new Vector(0, 1); let angleBA = v0.angleBetween(ba) * 180 / Math.PI; if (angleBA < 0) angleBA += 360; let angleBC = v0.angleBetween(bc) * 180 / Math.PI; if (angleBC < 0) angleBC += 360; let smallest = Math.min(angleBA, angleBC); let largest = Math.max(angleBA, angleBC); let angle = largest - smallest; return (cw) ? angle : 360 - angle; } function sortSmallestAngle(a, b, list, cw) { list.sort((m, n) => { let vab = new Vector(a.position.x - b.position.x, a.position.y - b.position.y); let vmb = new Vector(m.position.x - b.position.x, m.position.y - b.position.y); let vnb = new Vector(n.position.x - b.position.x, n.position.y - b.position.y); if (cw) return vab.angleBetween(vmb, cw) - vab.angleBetween(vnb, cw); else return vab.angleBetween(vnb, cw) - vab.angleBetween(vmb, cw); }); } // a is in list, b is in the other list function getPotential(a, b, list, cw) { sortSmallestAngle(b, a, list, cw); for (let i = 0; i < list.length - 1; i++) { let angle = angleBetween(b, a, list[i], cw); if (angle > 180) return false; else if (inCircle(a, b, list[i], list[i + 1]) <= 0) return list[i]; else { a.removeNeighbor(list[i]); list[i].removeNeighbor(a); } } let potential = list[list.length - 1]; if (potential) { let angle = angleBetween(a, b, potential, cw); if (angle > 180) return false; return potential; } return false; } function merge(leftNodes, rightNodes, leftBase, rightBase, hardnessMap) { leftBase.addNeighbor(rightBase); rightBase.addNeighbor(leftBase); let newLeft = leftNodes.filter((n) => n != leftBase); let newRight = rightNodes.filter((n) => n != rightBase); let potentialLeft = getPotential(leftBase, rightBase, newLeft, false); let potentialRight = getPotential(rightBase, leftBase, newRight, true); if (!potentialLeft && !potentialRight) return; else if (potentialLeft && !potentialRight) merge(newLeft, newRight, potentialLeft, rightBase, hardnessMap); else if (potentialRight && !potentialLeft) merge(newLeft, newRight, leftBase, potentialRight, hardnessMap); else { if (inCircle(leftBase, rightBase, potentialLeft, potentialRight) <= 0) merge(newLeft, newRight, potentialLeft, rightBase, hardnessMap); if (inCircle(leftBase, rightBase, potentialRight, potentialLeft) <= 0) merge(newLeft, newRight, leftBase, potentialRight, hardnessMap); } } // divide and conquer algorithm function delaunay(nodes, hardnessMap) { if (nodes.length <= 3) { for (let i = 0; i < nodes.length; i++) for (let j = 0; j < nodes.length; j++) if (i != j) nodes[i].addNeighbor(nodes[j]); return nodes; } else { nodes.sort((a, b) => { let tmp = a.position.x - b.position.x; if (tmp === 0) return b.position.y - a.position.y; return tmp; }); let l = nodes.length; let leftNodes; let rightNodes; if (l === 4) { leftNodes = delaunay(nodes.slice(0, 3), hardnessMap); rightNodes = delaunay(nodes.slice(3, 4), hardnessMap); } else { leftNodes = delaunay(nodes.slice(0, Math.floor(nodes.length / 2)), hardnessMap); rightNodes = delaunay(nodes.slice(Math.floor(nodes.length / 2), nodes.length), hardnessMap); } let leftBase = getLowest(leftNodes); let rightBase = getLowest(rightNodes); merge(leftNodes, rightNodes, leftBase, rightBase, hardnessMap); console.log("=============================MergeComplete================================"); return nodes; } }
  12. The best way to learn is to practice as much as possible. Share your examples here. What browsers WebGL is supported, you can see here: WebGL 1.0: https://caniuse.com/#feat=webgl WebGL 2.0: https://caniuse.com/#feat=webgl2 A brief description of what WebGL is, and references to the specifications: https://www.khronos.org/webgl/ Tutorials: WebGL 1.0 Fundamentals WebGL 2.0 Fundamentals This book is about WebGL 1.0: WebGL Programming Guide Source Code for the book: examples.zip Source Code for the book on JSFiddle: Chapter 02. Your First Step with WebGL ch02/HelloCanvas: https://jsfiddle.net/8Observer8/2gky294r/ ch02/HelloPoint1: https://jsfiddle.net/8Observer8/cc72u1u5/ ch02/HelloPoint2: https://jsfiddle.net/8Observer8/uxw657ud/ ch02/ClickedPoints: https://jsfiddle.net/8Observer8/xf4fnc0o/ ch02/ColoredPoints: https://jsfiddle.net/8Observer8/gkkmnpga/ Chapter 03. Drawing and Transforming Triangles ch03/MultiPoint: https://jsfiddle.net/8Observer8/cty1120m/ ch03/HelloTriangle: https://jsfiddle.net/8Observer8/wk4sksnw/ ch03/HelloQuad: https://jsfiddle.net/8Observer8/g4ctyk7w/ ch03/HelloQuad_FAN: https://jsfiddle.net/8Observer8/v119e8o6/ ch03/HelloTriangle_LINES: https://jsfiddle.net/8Observer8/wwrkaxcf/ ch03/HelloTriangle_LINE_STRIP: https://jsfiddle.net/8Observer8/3ggjz4rm/ ch03/HelloTriangle_LINE_LOOP: https://jsfiddle.net/8Observer8/7vcyquro/ ch03/TranslatedTriangle: https://jsfiddle.net/8Observer8/0dp4xvyt/ ch03/RotatedTriangle: https://jsfiddle.net/8Observer8/gh9s6szm/ ch03/RotatedTriangle_Matrix: https://jsfiddle.net/8Observer8/7ze7pgpu/ ch03/ScaledTriangle_Matrix: https://jsfiddle.net/8Observer8/6xzoe63s/ Chapter 04. More Transformations and Basic Animation ch04/RotatedTriangle_Matrix4: https://jsfiddle.net/8Observer8/t4y7783v/ ch04/RotatedTranslatedTriangle: https://jsfiddle.net/8Observer8/b5yfxojp/ ch04/TranslatedRotatedTriangle: https://jsfiddle.net/8Observer8/o8voebc9/ ch04/RotatingTriangle: https://jsfiddle.net/8Observer8/x9j5vdk7/ ch04/RotatingTranslatedTriangle: https://jsfiddle.net/8Observer8/rkrv0322/ ch04/RotatingTriangle_withButtons: https://jsfiddle.net/8Observer8/wzoLmdzd/ Chapter 05. Using Colors and Texture Images ch05/MultiAttributeSize: https://jsfiddle.net/8Observer8/dsfgezbj/ ch05/MultiAttributeSize_Interleaved: https://jsfiddle.net/8Observer8/bshwnden/ ch05/MultiAttributeColor: https://jsfiddle.net/8Observer8/bveykLdf/ ch05/ColoredTriangle: https://jsfiddle.net/8Observer8/mrkpms7d/ ch05/HelloTriangle_FragCoord: https://jsfiddle.net/8Observer8/ft33yo9s/ ch05/TexturedQuad: https://jsfiddle.net/8Observer8/o3vakb3h/ ch05/TexturedQuad_Repeat: https://jsfiddle.net/8Observer8/2s7q68cc/ ch05/TexturedQuad_Clamp_Mirror: https://jsfiddle.net/8Observer8/mqu0wwma/ ch05/MultiTexture: https://jsfiddle.net/8Observer8/ztew5u0p/ Chapter 07. Toward the 3D World ch07/LookAtTriangles: https://jsfiddle.net/8Observer8/6ab11xpg/ ch07/LookAtRotatedTriangles: https://jsfiddle.net/8Observer8/944dd57h/ ch07/LookAtRotatedTriangles_modelViewMatrix: https://jsfiddle.net/8Observer8/e5t6gj1w/ ch07/LookAtTrianglesWithKeys: https://jsfiddle.net/8Observer8/38ewegg2/ ch07/OrthoView: https://jsfiddle.net/8Observer8/zebt4u7t/ ch07/LookAtTrianglesWithKey_ViewVolume: https://jsfiddle.net/8Observer8/vLcejtm1/ ch07/OrthoView_halfSize: https://jsfiddle.net/8Observer8/uvcd9h4p/ ch07/OrthoView_halfWidth: https://jsfiddle.net/8Observer8/vepodfb8/ ch07/PerspectiveView: https://jsfiddle.net/8Observer8/640pv8qe/ ch07/PerspectiveView_mvp: https://jsfiddle.net/8Observer8/w8yh4Lmj/ ch07/PerspectiveView_mvpMatrix: https://jsfiddle.net/8Observer8/hhwnx145/ ch07/DepthBuffer: https://jsfiddle.net/8Observer8/hyumw026/ ch07/Zfighting: https://jsfiddle.net/8Observer8/foc0b45t/ ch07/HelloCube: https://jsfiddle.net/8Observer8/rkpn5tyw/ ch07/ColoredCube: https://jsfiddle.net/8Observer8/80x8cyom/ ch07/ColoredCube_singleColor: https://jsfiddle.net/8Observer8/pespackq/ Chapter 08. Lighting Objects ch08/LightedCube: https://jsfiddle.net/8Observer8/4jchxo84/ ch08/LightedCube_animation: https://jsfiddle.net/8Observer8/ekw3osj7/ ch08/LightedCube_ambient: https://jsfiddle.net/8Observer8/y6qwnfe1/ ch08/LightedTranslatedRotatedCube: https://jsfiddle.net/8Observer8/pa88ujjg/ ch08/PointLightedCube: https://jsfiddle.net/8Observer8/vuq118ue/ ch08/PointLightedCube_animation: https://jsfiddle.net/8Observer8/5bj39hb8/ ch08/PointLightedSphere: https://jsfiddle.net/8Observer8/edz9Lz8f/ ch08/PointLightedSphere_perFragment: https://jsfiddle.net/8Observer8/qzwyow4j/ ch08/PointLightedCube_perFragment: https://jsfiddle.net/8Observer8/8t1umamf/ ch08/LightedCube_perFragment: https://jsfiddle.net/8Observer8/471y2t84/ Chapter 09. Hierarchical Objects ch09/JointModel: https://jsfiddle.net/8Observer8/vqse5egz/ ch09/MultiJointModel: https://jsfiddle.net/8Observer8/sL53wkn3/ ch09/MultiJointModel_segment: https://jsfiddle.net/8Observer8/ygvk7odv/ Chapter 10. Advanced Techniques ch10/RotateObject: https://jsfiddle.net/8Observer8/1f5hLmff/ ch10/PickObject: https://jsfiddle.net/8Observer8/owue624n/ ch10/PickFace: https://jsfiddle.net/8Observer8/edvw6z90/ ch10/HUD: https://jsfiddle.net/8Observer8/fLxxxs35/ ch10/3DoverWeb: https://jsfiddle.net/8Observer8/tbowcc16/ ch10/Fog: https://jsfiddle.net/8Observer8/6yf9L399/ ch10/Fog_w: https://jsfiddle.net/8Observer8/8aLvthc3/ ch10/RoundedPoints: https://jsfiddle.net/8Observer8/sjs5kmn4/ ch10/LookAtBlendedTriangles: https://jsfiddle.net/8Observer8/apoz294n/ ch10/BlendedCube: https://jsfiddle.net/8Observer8/xsrL2fs5/ ch10/ProgramObject: https://jsfiddle.net/8Observer8/jnd0j6w0/ ch10/FramebufferObject: https://jsfiddle.net/8Observer8/vaLq6d66/ ch10/Shadow: https://jsfiddle.net/8Observer8/jsnfwcae/ ch10/Shadow_highp: https://jsfiddle.net/8Observer8/brjzr00n/ ch10/Shadow_highp_sphere: https://jsfiddle.net/8Observer8/4fmyLy5f/ ch10/OBJViewer: https://jsfiddle.net/8Observer8/pws1x7uv/ ch10/RotatingTriangle_contextLost: https://jsfiddle.net/8Observer8/vs01s8Lz/ Gifts gifts/Particle: https://jsfiddle.net/8Observer8/Ltzt31vk/ gifts/Printf: https://jsfiddle.net/8Observer8/qsw7jtec/ gifts/SpecularCube: https://jsfiddle.net/8Observer8/z4xj9rbv/ gifts/TextTexture: https://jsfiddle.net/8Observer8/qt7q2kuf/ gifts/ThreeDUI: https://jsfiddle.net/8Observer8/zdw1f2st/ gifts/Wave: https://jsfiddle.net/8Observer8/eL9odthz/ gifts/WorldCoordinateSystem: https://jsfiddle.net/8Observer8/6utj3hnk/ appendix/CoordinateSystem: https://jsfiddle.net/8Observer8/dzz056jt/ Appendix appendix/CoordinateSystem_viewVolume: https://jsfiddle.net/8Observer8/apxLww1q/ appendix/LoadShaderFromFiles: https://jsfiddle.net/8Observer8/wdn9ubhj/
  13. Hacking Francois DIY

    From the album Francois DIY 2017

    Francois DIY is written in 100% JavaScript and runs quite smoothly on the PC environment. Currently there are no plans to rewrite the code in other languages as there would be little improvement. It is open source and free to hack. I suggest using an editor with a code navigator or function lister for ease of access. There is also a built-in JavaScript debugger as well. Why JavaScript? The main purpose is to allow the app to demo on the browser as well as run on the PC. There are no plans to port to small devices. Possible future port with be on a tablet if they are powerful enough in the future. Not sure if recoding will be done in JavaScript.
  14. How do i enable players coming to a game from being timedout while waiting for other gamers to join? Must be from the app side not the gamer side.
  15. I need who could get a website game to get more users. I was the developer, and I have finally finished the project, I cannot get it to go anywhere, so I'm just looking for a business partner or anyone who can help me get it anywhere, we can discuss anything over Skype just add me @ randomeguy123 or email zack.mitkin@gmail.com thank you very much for reading, and I hope to see your replies!
  16. I am a beginner programmer who want to make simple 2D puzzle games for Windows platform using Javascript. So I was wondering what are some good tools to achieve this. So far I have tried the Universal Windows Platform app thing. But a limitation of this method seem to be that it only supports Windows 10 as target platform. I wish to support Windows 8 as well.
  17. As a student currently enrolled in Computer Programming, I have found it difficult to obtain an internship with my limited knowledge and underwhelming professional experience. Most companies I applied to required 3-5 years experience, which seemed impossible to achieve if I was not given the initial opportunity to be hired. However, I was determined not to let that stop me and thus created my own independent gaming studio - World's End Entertainment. Our current work force has grown and now consists of four artists, and three programmers. All friendly and hard working individuals. Our first game Shield Smash, is an RPG Idle Adventurer which is written using html, css, javascript and the game engine Construct 2. The art is created with Photoshop and Kritika. The game is still underdevelopment but is steadily progressing. We are currently looking to expand our team with more programmers and artists, especially those well versed with pixel art. Upon completion of the game, Shield Smash will be launched on Kongregate, where you will each receive full credit as a part of World's End Entertainment. If the game makes money, the money will be divided evenly among the team. Please feel free to showcase the game as part of your portfolio. To Apply If you would like to join our team at World's End Entertainment, please feel free to send me your resume at gerarddummett1@yahoo.ca where I guarantee you that I will personally get back to you in a timely manner. The subject line should state: Resume for World's End Entertainment. Our team currently consists of seven members from around the world and we are more than happy to have that number continue to grow. Discussions and meetings will be held via Skype and through Emails. Thank you for taking your time to consider working with us, and we look forward to hearing from you.
  18. Me and my unity developer friend starting new project of poker game in unity(win,mac,android,ios only, web is not priority). We did some home work for how we can make game engine(game server) for this project and we finally come up with 2 names mostly. NODE.JS and SOCKET.IO + UNITY(frontend client). I already started learning node.js from basic and did some learning progress in that too. but I am still new for node. So I am really confuse about how we can connect our game server with our client/s. Can I make API or WebServices or is there any other method for node to contact unity clients? I need someone who can guide me for this project with step by step or give me direction in details to make this project complete. Please Direct me.
  19. Axis 3D for Web

    Axis is a free open source 3D engine for web pages and desktop applications. It's been a month since its official release with full source code, editor and all and there is more content available now like samples, info pages, API documentation and recently the team opened the discussion pages on the site where anyone can get help. From the team: Check out the latestaddition, a small 80-lines-of-code prototype of a space flyer game, playable on the web at http://palitri.com/axis/showcase/#Space You can learn more at http://palitri.com.
  20. Axis 3D for Web

    Axis is a free open source 3D engine for web pages and desktop applications. It's been a month since its official release with full source code, editor and all and there is more content available now like samples, info pages, API documentation and recently the team opened the discussion pages on the site where anyone can get help. From the team: Check out the latestaddition, a small 80-lines-of-code prototype of a space flyer game, playable on the web at http://palitri.com/axis/showcase/#Space You can learn more at http://palitri.com. View full story
  21. Html Space flyer

    A simple prototype for a 3d space/flight game done with Axis in 80 lines of code. Playable here http://palitri.com/axis/showcase/#Space
  22. Sad Robo Direct link to my game hosted on github : https://anicetngrt.github.io/SadRoboGame/ Direct link to the itch.io page for extra infos (and also to help game's visibility) : https://an-devhouse.itch.io/sad-robots- Requirements This is a web browser game, the main issue and requirement at the same time is that you'll need firefox to play it I do not benchmark pc with phaser.js 2d games so I guess if you have 2go of ram and a 1.5hGhz cpu it is fine. Feedback I'm new in this indie game dev world so any kind of feedback is appreciated. Just try to avoid bug report because my game isn't that complex so I know my bugs already. About my game My game is a 2d arena shooter multiplayer and singleplayer experience. 2 players or 1 player versus AI fight in an empty level by shooting each others. And then you are like "what ? empty level ? That's boring !". Well, not exactly. There is a lot of original 2d shooter mechanics which turn "sad robo" into an original and demanding game despite it minimalist level design. Aiming system : This is the core of the game. Each player, has an aiming cursor, which he can move freely as far as he do not cross red fences which's location changes constantly. Despite the "empty level" he'll have to jump, run, dash to find the right aiming pose and to win. Artistic choices : I made everything in this game except music* because I am so bad at this . The idea was to show how much pointless fights are. For that, I decided to choose maximum contrasty between game visuals and game context. Here are some exemples : - colourfull game / combat theme - happy and kawaï robots/ robots fighting to death - family friendly world/ hard rock ost *game music by Stone McKnuckle : https://stonemcknuckle.bandcamp.com/track/lightning-mandrill-remaster Others things to talk about : The game still have update ! It has been released 3 days ago and I updated it 5 times already ! This will not always be like this because of studies but it will still be updated ! Also there is a work in progress roadmap on the Itch.io page so don't forget to check it out ! If you like my game, and you want to give support, please share it to your friends. And let the sad robots spread into the entire wolrd niark niark. #1 Anicet, 57 minutes ago
  23. Strawberry Alert: Day 3

    Play it! | View on GitHub I couldn't do much today, but at least I added collisions and jumping. You won't see much difference, but now there's gravity pulling the character down and she's colliding against the floor instead of having a fixed y position. After jumping or attacking, the character doesn't resume movement if the right arrow is pressed, I will try to fix that tomorrow (Fixed, I should totally go to sleep now). Also, either tomorrow or Friday I should be able to start adding enemies and stuff. My initial idea was to let the player move freely through the map and have as a level goal clear it of alien enemies. I'm thinking now that an easier option might be make it endless runner style and have a certain amount of time to kill as many enemies as possible. I wish I had time to try out both and see which one is more fun, but I doubt it will be possible.
  24. I have implemented client interpolation and it works well. But I don't like my current structure. It looks really ugly and created too many temporary objects, besides that it is really hard to maintain the code. I am not going to show too many logic here as it is very tightly coupled with other parts of my game. Note that my code is written in javascript but if you show me some direction in generic language or C++ that's OK too because I think the logic should not be too different. In my game I have hundreds of players and other NPCs, and every network update I get a timestamp. I just bundle them up in a very big state object. Let's call it "currentRenderState", similarly I have "previousRenderState" and "futureRenderState", which means the state I receive in last update and the state I receive in current update. I am going to interpolate from "previousRenderState" to "futureRenderState". The interpolation result will be stored in "currentRenderState". If next update state hasn't arrived and the player state hasn't reached "futureRenderState" I will interpolate from "currentRenderState" to "futureRenderState". So my state object contains a lot of information. state = { timestamp, allPlayerStates, allNPCStates } Here "allPlayerStates" is a very big object too. It contains all the states of all players and each player contains dozens or even hundreds of properties. Every time I interpolate I need to clear the object in currentRenderState, also I need to reference allPlayerStates and allNPCStates in "previousRenderState" and "futureRenderState" to get one of the individual state and interpolate it. At the end of the interpolation I create a very big temporary state object and put the interpolation value into this state object and assign to "currentRenderState". Then in the interpolation code I loop through the "allPlayerStates" of "currentRenderState", and assign the value to each player on client side. Also I loop through "allNPCStates" to assign the value to each NPC on client side. This logic works, but I feel tiresome each time I read through my code. Is there a better way to organise my interpolation code, and probably make it more efficient too?
  25. Strawberry Alert: Day 1

    Strawberry Alert: Day 1 Today I have started working on the Week of Awesome V challenge. The working title for the project is Strawberry Alert. I generated it randomly and it is very unlikely to change due to time constraints. The Project The themes I want to try are Alien invasion and Castles. My intention is to create a side scroller where the hero must defend her castle from an alien invasion. With this project I want to explore whether functional reactive programming can be successfully used in games. I intend to capture the user input and time effects into streams, apply map-reduce to these streams to generate the game state, and finally render that game state to the screen. I will be happy if I can deliver something playable by the end of the week. Unfortunately, this week I'm back to work after vacation and I've got a few social commitments that I must honour, so I expect to be able to dedicate only about twelve hours more to the project. So far, I have managed to put together a parallax background and the walking animation for the hero sprite. The Art I am using a hero sprite and castle tiles created by Jetrel. I still need to find sprites for the alien enemies. The Tools I will target the browser and create my game using JavaScript. My weapons of choice are: pixi.js: a rendering library for WebGL and Canvas. cyclejs: a functional reactive framework. xstream: a stream library designed to work well with cyclejs. The Links The code is available on GitHub and, since it is a browser game, I will deploy my daily progress so that you guys can try it out. GitHub Game
  • Advertisement