Advertisement Jump to content
  • Advertisement

Search the Community

Showing results for tags 'C#'.



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

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • Game Dev Loadout
  • Game Dev Unchained

Categories

  • Game Developers Conference
    • GDC 2017
    • GDC 2018
  • Power-Up Digital Games Conference
    • PDGC I: Words of Wisdom
    • PDGC II: The Devs Strike Back
    • PDGC III: Syntax Error

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
  • Community
    • GameDev Challenges
    • 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
  • Topical
    • Virtual and Augmented Reality
    • News
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical
  • GameDev Challenges's Topics
  • For Beginners's Forum
  • Unreal Engine Users's Unreal Engine Group Forum

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams
  • GameDev Challenges's Schedule

Blogs

There are no results to display.

There are no results to display.

Product Groups

  • Advertisements
  • GameDev Gear

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Website


Role


Twitter


Github


Twitch


Steam

Found 450 results

  1. Hi, I'm seeking people interested in help making "Galaxy Forces VR" a great game. I'm currently alone and like someone that can create simple 3D-models, and a programmer to join the team. The project is being developed using Unity/C#. It's a 2D game, but viewed in 3D. The game is based on my project "Galaxy Forces V2", but this will be single player only, and support the game modes race and mission. There will be global hi-scores on the website with replays of the record scores and ranking of top players, as it adds a lot to the game. And also keeps players interested for longer time. Everything is not written in stone, there are possibilities for someone creative to add their own ideas. In fact I encourage any team member to test and think about different options of how to make the game better. A change to the original is that this will be easier to play for beginners to make it more attractive but not easier to master fully. This is the original complete version: http://www.galaxy-forces.com/ I'm new to Unity, and only have a little knowledge of how to create 3D models. I know C++ fully, but C# is mostly the same. I might get the coding done myself, but it would feel better to have one more person coding and testing their ideas. I share a picture from the development, and a demo version in current state, so you can decide if you want to join. The plan is to release it on the Oculus Store in half a year. I have a todo list, and I promise to do what I can and spend much time on this to get it done to completion. I like to share the profits with those who want to join and have actually done something that pushes the project forward. The demo runs on Windows without VR, but Oculus Rift is recommended to be able to choose level in the menu (otherwise press Return to play the default level)... Galaxy Forces VR v0.1 https://drive.google.com/open?id=1GpcfMzAsgsBPkht_RV3lTJcRR0zI3AKo The presentation right now may not be the final result, especially the menu needs a new look with more contents. It is true that it is a hobby project, but I think it has great chances to get accepted by Oculus. There is a large contents of 50 levels for one thing, and the levels don't need much work to reuse for this project. Also since VR is not main stream, and there aren't so many games released, it will not drown in the noise as easily. And I think VR people buy more games than most, at least I do. This is the full TODO list, that covers most of the needed work from now to release. I think the time plan is realistic... Map elements - Landing zone, hangar building - low poly model (only visual) - Landing zone, antenna - low poly model (only visual) - Map decorations, trees - low poly model (visual, and collision in map) - Map decorations, barrels - low poly model (visual, and collision in map) - Map decorations, red/green house in 3 parts (left, center, right) - low poly model (visual, and collision in map) - Z-objects for decoration. Objects that can be placed in a map that are larger and sticks out towards the player to make it more visually pleasing to play VR, for example brick walls in different shapes (only visual, placed inside walls not accessible to the ship) The levels - Now there are 23 race levels and 23 mission levels. There also exist levels for dogfight and mission_coop, take these levels and convert them to race and mission to get 50+ levels - Need to fix the editor to make it possible to place the new Z-objects in the maps and go through each map and add them Door element - A low poly model for the end points of the door (only one needs to be created, can be rotated in 4 different angles to make all parts) - Implement the door element in code Enemies - Create them in 3D [enemy 0..6] - Implement them in code Game Status - Race: show Time, Current checkpoint, Current lap/Total laps, Health bar - Mission: show Lives, Health bar, Fuel bar, Cargo bar, Score Sound - Add existing music to the menu and game - Add existing sound fx in the game Menu - More contents (could be Game Name text/logo, animated objects, clouds, anything really) - Better gfx (different textures for the level select elements) - Show your score vs the world best on each level, also show your rank (gold, silver or bronze) - Make part 2 of the menu - after a level is selected in part 1, shows 3 options - play, play your best replay, play the world record replay - Settings to turn the music on/off (+a minimum of other settings). The VR room around the player - More contents (could be clouds and a skybox, or a room, or blackness in space, anything really) Replay - Implement replays in code - Online hiscores - that is, be able to send/load the replays to the website (either HTTP or HTTPS if possible, maybe easy to do HTTPS with C# ?) - The hiscore implementation on the website. (mostly done already) Website - www.galaxy-forces-vr.com exists. - Better/more contents + the hi-scores Release - Images in different sizes for release on the Oculus Store - Game play promotion video - Test/fix it working on minimum req hardware The demo + the todo list should help get a picture of what this game will be and help you decide if you want to join and if you have the skills needed. Hope to hear from you.
  2. well Hello internet , greeting to all of you smart beautiful Developers people its something i dream about to make my own simple 2D game engine from scratch and to make it Easy for my self i thought ill be able to use C# for the game coding and Basic manipulation and Animation , and C++ for the Graphic Engine and the heavy stuff of Importing and exporting and rendering but the problem is i only have Experience in C# and Graphic and Illustration Design ( that's = no worry about the Animation and Assets ) so i don't Have any Experience in SDL/OpenGL or C++ i only know some Basic , and since SDL/OpenGL tutorials are available in youtube i didnt find an advanced one talking about combining between C# and C++ like Unity3D did in their engine any help in this will be Awesome
  3. Tristan Patrick Richter

    C# WC3 Trigger Style System

    If I wanted to a create a WC 3 trigger style event queue inside my ECS-style game engine, how would I go about doing that?
  4. Hi guys A while back I wrote a small app using C# and MoonSharp to execute a Lua script that would call functions from within my C# app, that would call GDI+ draw commands. This way I could see how my draw elements were being positioned in real time and adjust as I wished as can be seen in the image below. However, I am now looking at creating my own library that will use D3D11 instead of GDI+ to render 2D shapes, and I would like to create the same scripting tool, but this time I want it to use C#. Is there anything like this out there?
  5. It's been a while since I posted any code.. Here are some handy methods that I've been using frequently in my SlingBots game. Keep in mind, some examples use local variables where it's better to reuse variables with more scope for memory/GC reasons in practical application. If you see something that I could really improve, please let me know. Many of these are "setup" routines so I've not bothered with optimization really at all since they run once, or very infrequently. All of these are designed to work with the standard Unity orientation, with normal terrain objects or terrain meshes. RayCast Position of Ground at any point on terrain: Vector3 GroundPosAt(Vector3 position) { Vector3 result = position; //some altitude above the highest possible ground position. float checkAltitude = 2000.0f; Ray rr = new Ray(new Vector3(position.x, checkAltitude, position.z), -Vector3.up); //I use a fixed allocation ray cast as a general practice to keep GC down. //It will need to be big enough to contain all the possible hits it could catch finding your ground object.. //YMMV with these *NonAlloc methods, but they work wonderfully for me. RaycastHit[] hits = new RaycastHit[20]; if (Physics.RaycastNonAlloc(rr, hits) > 0) { foreach(RaycastHit hit in hits) { //make sure this entry isn't null if (hit.collider != null) { //check for collision with object tagged ground if (hit.collider.CompareTag("ground")) { result = hit.point; } } } } return result; } Get A Vector3 position on a Circle at a specific angle and radius: Vector3 CirclePos(Vector3 center, float radius, float angle) { Vector3 pos; pos.x = center.x + radius * Mathf.Sin(angle * Mathf.Deg2Rad); pos.y = center.y; pos.z = center.z + radius * Mathf.Cos(angle * Mathf.Deg2Rad); return pos; } Object Placement using fixed arrays for object tracking and management: This example shows one of the ways I programmatically instantiate turrets into SlingBot Boarding. public GameObject worldTurretPrefab; GameObject[] worldTurrets = new GameObject[100]; SnowBallTurret[] _worldTurrets = new SnowBallTurret[100]; void PlaceWorldTurret(GameObject parentobject, Vector3 position, int firefrequency, float firepower, float sightdistance) { for (int i = 0; i < worldTurrets.Length; i++) { if (worldTurrets[i] == null) { if (parentobject == null) { worldTurrets[i] = Instantiate(worldTurretPrefab); } else { worldTurrets[i] = Instantiate(worldTurretPrefab, parentobject.transform, false); } _worldTurrets[i] = worldTurrets[i].GetComponentInChildren<SnowBallTurret>(); _worldTurrets[i].playerAvatar = GameController.GControl.Player; _worldTurrets[i].fireFrequency = firefrequency; _worldTurrets[i].id = (i + 1).ToString(); _worldTurrets[i].turretProjectileVelocity = firepower; _worldTurrets[i].turretSightingDistance = sightdistance; worldTurrets[i].transform.localPosition = position; break; } } } I use an array for both the object and a reference to the script it holds to save time on future getcomponent lookups. This will come in handy when I want to upgrade the settings on all of the already instantiated objects due to a player increase in level/etc. I use a fixed array so I can predict(reasonably) what the upper level of memory usage will be(after testing). I iterate through the existing collection and only add a new object if there is an empty slot in the array. This allows me to ensure there will be ZERO runtime exceptions related to object instantiation. It is better for my game to end up being a little easier than it should have been than it would be for an exception to be thrown right at an exciting moment. Note: the above method could be easily modified to return a bool on success/failure if you wanted to adjust the object arrays and try again on failure. Putting this all together, here's instantiating Turrets in a circle around a specific point(on uneven terrain): void PlaceTurretsCircle(Vector3 position, int turretcount, float turretradius) { //place turrets in circle for (int i = 0; i < turretcount; i++) { //Adjust settings based on players level float levelModifier = 1.0f; if (currentGameLevel > 1) { //add 20% to modifier for each level levelModifier += (0.2f * currentGameLevel); } //Calculate angle for object around circle float angl = (360 / turretcount) * i; PlaceWorldTurret(null, GroundPosAt(CirclePos(position, turretradius, (360 / turretcount) * i)), (int)(2000.0f / levelModifier), 50.0f * levelModifier, 500.0f); } } and a bonus, Here's placing turrets on a Grid: This one is presently written to require a parent object as it places the turrets in relative position to that object. void PlaceTurretsGrid(GameObject parentobject, float xstart, float zstart, float xrowdist, float zrowdist, float yoffset, int xrowcount, int count, int firefrequency, float firepower, float sightdistance) { float xoffset = xstart; float zoffset = zstart; if (count > 100) count = 100; int xmaxcount = xrowcount - 1; int xcount = 0; for (int i = 0; i < count; i++) { //Without ground position checking PlaceWorldTurret(parentObject, new Vector3(xoffset, yoffset, zoffset), turretFireFrequency, turretFirePower, turretSightDistance); //With ground position checking(untested) //PlaceWorldTurret(parentObject, GroundPosAt(parentObject.position + new Vector3(xoffset, yoffset, zoffset)), turretFireFrequency, turretFirePower, turretSightDistance); xcount++; xoffset += xrowdist; if (xcount > xmaxcount) { xcount = 0; xoffset = xstart; zoffset += zrowdist; } } } Not a lot of rocket science going on here, but it could be a time-saver or a mental-block fixer for somebody I'm sure. Check out the game if you get a chance: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding/ Happy coding out there!!
  6. DabbingTree

    Join my Ludum Dare team!

    I am joining a team for Ludum Dare 43, and I need a designer and an artist. We will use Unity3D for the game engine. https://crowdforge.io/jams/ludumdare/teams/2621
  7. does anyone have an example of how to load skinned mesh from .x file with animations? I managed to load mesh but can't figure out how to load animations. For any example or at least some suggestion on how to deal with it, i would be very grateful. And should be done with slimdx and directx 9.
  8. Hi, I'm doing some experimenting on network architecture and currently working on my multiplayer RPG game. The game is written in c# (of course) and the client\single player part has basic functionality, so now I've started working on the network side of stuff. I've heard about KryoNet(Java) and it seems like a good solution for my server. But as I'm fairly new with C#, I wasn't sure what is the best library to go along with it on the client side. There is no KryoNet-like library in C#, so I was wondering if you have any recommendation on a library you know, or should I just use the basic system.net of C# and try to learn from that. I would gladly accept any tips! Thank you!
  9. COMPANY AND THE PROJECT We are an indie game studio consisted of professional and skilled artists who are dedicated indie enthusiasts. Our current project is INT, developed on Unity Engine 5 for platforms Windows, Linux, and Mac. We are recruiting a few more members on the team to finalize our playable demo. INT is a 3D Sci-fi RPG with a strong emphasis on story, role playing, and innovative RPG features such as randomized companions. The focus is on the journey through a war-torn world with fast-paced combat against hordes of enemies. The player must accomplish quests like a traditional RPG, complete objectives, and meet lively crew members who will aid in the player's survival. Throughout the game you can side and complete missions through criminal cartels, and the two major combatants, the UCE and ACP, of the Interstellar Civil War. Please note that all of our current positions are remote work. You will not be required to travel. For more information about us, follow the links listed below. INT Official website IndieDB page Also follow social media platforms for the latest news regarding our projects. Facebook Twitter UNITY ENGINE PROGRAMMER We are looking for Unity Programmers. You will be working with our Coding team Lead to implement systems and mechanics using C# language. Your duties will include: Attendance of regular team meetings. Timely completion of implementation of assets. Direct contact with Project Lead and other Department Leads for the implementation process. Utilization of version control suites. Utilization of our project management boards (Trello) and communication channels to obtain up-to-date assets. REQUIREMENTS To be successful in this position, following requirements apply: Clear communication and self starter - pushes to meet deadlines and contribute to the project. Ability to complete tasks with limited input/direction from management. Comfortable with working with people remotely and via Trello management system. Good internet connection with ability to update assets/builds quickly, with large dependencies. At least 15 hours of availability each week. Proficient experience using the Unity Game Engine. Proficient experience in implementing assets into the Unity Game Engine. OTHER OPEN POSITIONS 3D Environment Modeller Website Manager 3D Character Modeller REVENUE - SHARE The project is marching increasingly closer to be ready for our crowd-funding campaign. Being an Indie team we do not have the creative restrictions often imposed by publishers or other third parties. We are extremely conscientious of our work and continuously uphold a high level of quality throughout our project. We are unable to offer wages or per-item payments at this time. However revenue-sharing from crowd-funding is offered to team members who contribute 15-20 hours per week to company projects, as well as maintain constant communication and adhere to deadlines. Your understanding is dearly appreciated TO APPLY Please send your Cover Letter, CV, Portfolio (if applicable), and other relevant documents/information to this email: JohnHR@int-game.net Thank you for your time! Please feel free to contact me via the email provided should you have any questions. We look forward to hearing from you! John Shen HR Lead Starboard Games LLC
  10. The Problem: Generate a method to score the players accuracy in navigating any loaded race course, on uneven terrain. The Data: Courses are recorded by users/players and stored as an array of positions that define the central "line" of the course. The player controller maintains a "ground normalized position" which is the "point" result of a raycast it performs periodically to determine its current grounded status. The Solution: Generate a "get line distance" method using the ground normalized position of the player, an increment only index counter to move down the line, and a few square magnitude calculations to produce the closest square magnitude distance to/from the "line". Use periodic samples from the "get line distance" method to calculate the overall average of the players navigation accuracy. The Code: coursePositions is a Vector3[] of the course positions, they are about 5m apart in the game world. courseFinishPosIndex = coursePositions.Length-1.. currentPositionIndex starts @ zero and only increments.. private float GetLineDistance() { //retrieve the player's current raycast to ground position. groundPosition = sbc.groundPosition; if (groundPosition == Vector3.zero) { //in case the player's raycast failed for some reason groundPosition = Player.transform.position; } if (currentPositionIndex + 1 <= courseFinishPosIndex) { //Calculate the square magnitude to the current index position and the next index position csm = (groundPosition - coursePositions[currentPositionIndex]).sqrMagnitude; nsm = (groundPosition - coursePositions[currentPositionIndex + 1]).sqrMagnitude; //Compare them while (csm > nsm && currentPositionIndex+1 < courseFinishPosIndex) { //Push the currentPositionIndex to the closest point on the line (to the player ground position). currentPositionIndex++; csm = (groundPosition - coursePositions[currentPositionIndex]).sqrMagnitude; nsm = (groundPosition - coursePositions[currentPositionIndex + 1]).sqrMagnitude; } while (csm < 1000 && currentPositionIndex +1 < courseFinishPosIndex) { //Push the currentPositionIndex to ~1000sqMag AHEAD of the player. currentPositionIndex++; csm = (groundPosition - coursePositions[currentPositionIndex]).sqrMagnitude; } } //return the current sqare magnitude. return csm; } Debug Implementation: In loop/at frequency of choice: courseDistanceAccum += GetLineDistance(); courseSamples++; Debug.Log("AvSqm: (" + courseDistanceAccum.ToString() + " / " + courseSamples.ToString() + ") " + (courseDistanceAccum/courseSamples).ToString()); Results: So far, excellent. Gives a wide range of values(if you stray off course) that are easy to categorize and it will work for any line based course. Now I just need to implement some logic based on the result. 1000-1200 = Perfect score 2000+ = Just foolin around. 3000+ = Trying not to try. 4000+ = Disqualification zone. CLARITY NOTE: These aren't the players "Final Score" this represents the average distance the player was from the central line of the course. Which I'll be translating into a Precision Percentage 0-100%(4000 - 1000) that will further modify the players overall standings. The point score I'm currently deriving from these numbers is calculated as follows: (in loop) courseDistanceAccum += GetLineDistance(); courseSamples++; if (courseDistanceAccum/courseSamples > 4000) { PlayerDisqualified(); } if (racePointTimer.ElapsedMilliseconds > 500) { //Sample the current average every .5 seconds. float curOffset = (4000 - (courseDistanceAccum / courseSamples)) / 10f; //Build point modifier. 300-0 if (curOffset < 100) curOffset *= -1; //Subtract points if player is too far off course. playerScore += curOffset; //Modify score. racePointTimer.Restart(); } Essentially, the player earns close to 300pts every .5 seconds they are reasonably within the course boundaries. If they go out of bounds, even for a short period, they experience a much lower score. It also takes some intention to get disqualified.
  11. I'm creating a simulator game in Unity. I understand how to generate random items from a list of variables. What I'm not sure is how to do it within a menu using the Unity UI. In the game, I'd like to create contracts inside of text box that the player can accept. If they highly the contract and hit 'accept', it begins a timer. There's 2 ways of doing this, and I'm specifically trying to do the second. The first way which I'm NOT wanting to go for, is generating buttons. Here's a screenshot example from Megapolis What I'm trying to figure out is like this, from Software Inc... the randomly generated items simply appear as text. ...but that show data columns. (My interface doesn't need to be anywhere near this detailed). I'm just wondering how to pack these items into a list... I can figure out how to make it look pretty later. Thanks -Jonathan
  12. All, I represent a team of 60 people who are currently working on the development of a Third person multiplayer shooter. Currently this is a passion projects and we seeking the skills of a expierenced programmer. Ideally we are looking for someone with the following skills: Unity Expierence in one of the following C# / Java /Python /Lua general idea in OOP. Neural networks for matchmaking, Or Neural networks for NPC behaviour. if you are interested to join click the below discord link, introduce yourself and join us. https://discord.gg/UMgEfzQ
  13. Hey Developers! If you already played No Man's Sky, you probally visited another planet, but the planets are a sphere (obviously duh) but when you are entering the atmosphere of the planet, the "curved terrain" turns into a flat terrain with moutains, etc... I'm creating a space travel system, and i want to simulate this "effect" but i don't have any idea how to do that idk if is a camera trick, a illusion etc... Help Me guys!
  14. TLDR: is there a way to "capture" a constantbuffer in a command list (like the InstanceCount in DrawIndexedInstanced is captured) so i can update it before the command list is executed? Hey, I want to draw millions of objects and i use instancing to do so. My current implementation caches the matrix buffers, so I have a constantbuffer for each model-material combination. This is done so I don't have to rebuild my buffers each frame, because most of my scene is static, but can move at times. To update the constantbuffers I have another thread which creates command lists to update the constantbuffers and executes them on the immediate context. My render thread(s) also create command lists ahead of time to issue to the gpu when a new frame is needed. The matrix buffers are shared between multiple render threads. The result is that when an object changes color, so it goes from one model-material buffer to another, it hides one frame and is visible at the next or is for one frame at a different location where an object was before. I speculate this is because the constantbuffer for matrices is updated immediately but the InstanceCount in the draw command list is not. This leads to matrices which contain old or uninitialized memory. Is there a way to update my matrix constant buffers without stalling every renderthread and invalidating all render command lists? regards
  15. I'm having trouble wrapping my brain around what actually is the issue here, but the sampler I'm using in my volume renderer is only interpolating the 3D texture along the Y axis. I roughly followed (and borrowed a lot of code from) this tutorial, but I'm using SlimDX and WPF: http://graphicsrunner.blogspot.com/2009/01/volume-rendering-101.html Here's an example, showing voxel-ish artifacts on the X and Z axes, which are evidently not being interpolated: ...whereas on the Y axis it appears to be interpolating correctly: If I disable any kind of interpolation in the sampler, the whole volume ends up looking voxel-ish / bad: Thinking maybe my hardware didn't support 3D textures (even though it's modern?) I wrote a little trilinear interpolation function, and got the same results. In the trilinear code, I calculate the position of the ray in grid coordinates, and use the fractional portion to do the lerps. So I experimented by just painting the fractional part of the grid coordinate where a ray starts, onto my geometry cast to a float4. As expected, the Y axis looks good, as my input dataset has 30 layers. So I see a white => black fade 30 times: However, my X and Z fractional values are strange. What I should be seeing is the same white => black fade 144 and 145 times, respectively. But what I get is this: ... which is definitely not right. The values are A) discretized and uniform per grid cell, and B) exhibit a pattern that repeats every handful of grid rows, instead of a smooth fade on each cell. My suspicion is that I'm initializing my texture badly, but here's a look at the whole pipeline from initialization to rendering 1) Loading data from a file, then constructing all my rendering-related objects: Data = new GURUGridFile(@"E:\GURU2 Test Data\GoshenDual\Finished\30_DOW7_(X)_20090605_220006.ggf"); double DataX = Data.CellSize[0] * Data.Dimensions[0]; double DataY = Data.CellSize[1] * Data.Dimensions[1]; double DataZ = Data.CellSize[2] * Data.Dimensions[2]; double MaxSize = Math.Max(DataX, Math.Max(DataY, DataZ)); DataX /= MaxSize; DataY /= MaxSize; DataZ /= MaxSize; Renderer.XSize = (float)DataX; Renderer.YSize = (float)DataY; Renderer.ZSize = (float)DataZ; int ProductCode = Data.LayerProducts[0].ToList().IndexOf("A_DZ"); float[,,] RadarData = new float[Data.Dimensions[0], Data.Dimensions[1], Data.Dimensions[2]]; for (int x = 0; x < Data.Dimensions[0]; x++) for (int y = 0; y < Data.Dimensions[1]; y++) for (int z = 0; z < Data.Dimensions[2]; z++) RadarData[x, y, z] = Data.Data[z][ProductCode][x, y]; int DataSize = Math.Max(RadarData.GetLength(0), Math.Max(RadarData.GetLength(1), RadarData.GetLength(2))); int mWidth = RadarData.GetLength(0); int mHeight = RadarData.GetLength(2); int mDepth = RadarData.GetLength(1); float mStepScale = 1.0F; float maxSize = (float)Math.Max(mWidth, Math.Max(mHeight, mDepth)); SlimDX.Vector3 stepSize = new SlimDX.Vector3( 1.0f / (mWidth * (maxSize / mWidth)), 1.0f / (mHeight * (maxSize / mHeight)), 1.0f / (mDepth * (maxSize / mDepth))); VolumeRenderer = new VolumeRenderEngine(false, Renderer.device); VolumeRenderer.Data = VolumeRenderTest.Rendering.TextureObject3D.FromData(RadarData); VolumeRenderer.StepSize = stepSize * mStepScale; VolumeRenderer.Iterations = (int)(maxSize * (1.0f / mStepScale) * 2.0F); Renderer.Initialize(); SetupSlimDX(); this.VolumeRenderer.DataWidth = Data.Dimensions[0]; this.VolumeRenderer.DataHeight = Data.Dimensions[2]; this.VolumeRenderer.DataDepth = Data.Dimensions[1]; It's worth noting here that I flip the Z and Y axes when passing data to the volume renderer so as to comply with DirectX coordinates. Next is my construction of the Texture3D and related fields. This is the step I think I'm messing up, both in terms of correctness as well as general violation of best practices. public static TextureObject3D FromData(float[,,] Data) { Texture3DDescription texDesc = new Texture3DDescription() { BindFlags = SlimDX.Direct3D11.BindFlags.ShaderResource, CpuAccessFlags = SlimDX.Direct3D11.CpuAccessFlags.None, Format = SlimDX.DXGI.Format.R32_Float, MipLevels = 1, OptionFlags = SlimDX.Direct3D11.ResourceOptionFlags.None, Usage = SlimDX.Direct3D11.ResourceUsage.Default, Width = Data.GetLength(0), Height = Data.GetLength(2), Depth = Data.GetLength(1) }; int i = 0; float[] FlatData = new float[Data.GetLength(0) * Data.GetLength(1) * Data.GetLength(2)]; for (int y = 0; y < Data.GetLength(1); y++) for (int z = 0; z < Data.GetLength(2); z++) for (int x = 0; x < Data.GetLength(0); x++) FlatData[i++] = Data[x, y, z]; DataStream TextureStream = new DataStream(FlatData, true, true); DataBox TextureBox = new DataBox(texDesc.Width * 4, texDesc.Width * texDesc.Height * 4, TextureStream); Texture3D valTex = new Texture3D(Renderer.device, texDesc, TextureBox); var viewDesc = new SlimDX.Direct3D11.ShaderResourceViewDescription() { Format = texDesc.Format, Dimension = SlimDX.Direct3D11.ShaderResourceViewDimension.Texture3D, MipLevels = texDesc.MipLevels, MostDetailedMip = 0, ArraySize = 1, CubeCount = 1, ElementCount = 1 }; ShaderResourceView valTexSRV = new ShaderResourceView(Renderer.device, valTex, viewDesc); TextureObject3D tex = new TextureObject3D(); tex.Device = Renderer.device; tex.Size = TextureStream.Length; tex.TextureStream = TextureStream; tex.TextureBox = TextureBox; tex.Texture = valTex; tex.TextureSRV = valTexSRV; return tex; } The TextureObject3D class is just a helper class that I wrap around a Texture3D to make things a little simpler to work with. At the rendering phase, I draw the back and front faces of my geometry (that is colored according to the vertex coordinates) to textures so that ray starting and ending positions can be calculated, then pass all that nonsense to the effect. private void RenderVolume() { // Rasterizer states RasterizerStateDescription RSD_Front = new RasterizerStateDescription(); RSD_Front.FillMode = SlimDX.Direct3D11.FillMode.Solid; RSD_Front.CullMode = CullMode.Back; RSD_Front.IsFrontCounterclockwise = false; RasterizerStateDescription RSD_Rear = new RasterizerStateDescription(); RSD_Rear.FillMode = SlimDX.Direct3D11.FillMode.Solid; RSD_Rear.CullMode = CullMode.Front; RSD_Rear.IsFrontCounterclockwise = false; RasterizerState RS_OLD = Device.ImmediateContext.Rasterizer.State; RasterizerState RS_FRONT = RasterizerState.FromDescription(Renderer.device, RSD_Front); RasterizerState RS_REAR = RasterizerState.FromDescription(Renderer.device, RSD_Rear); // Calculate world view matrix Matrix wvp = _world * _view * _proj; RenderTargetView NullRTV = null; // First we need to render to the rear texture SetupBlend(false); PrepareRTV(RearTextureView); SetBuffers(); Device.ImmediateContext.Rasterizer.State = RS_REAR; Renderer.RayCasting101FX_WVP.SetMatrix(wvp); Renderer.RayCasting101FX_ScaleFactor.Set(ScaleFactor); ExecuteTechnique(Renderer.RayCasting101FX_RenderPosition); Device.ImmediateContext.Flush(); Device.ImmediateContext.OutputMerger.SetTargets(NullRTV); // Now we draw to the front texture SetupBlend(false); PrepareRTV(FrontTextureView); SetBuffers(); Device.ImmediateContext.Rasterizer.State = RS_FRONT; Renderer.RayCasting101FX_WVP.SetMatrix(wvp); Renderer.RayCasting101FX_ScaleFactor.Set(ScaleFactor); ExecuteTechnique(Renderer.RayCasting101FX_RenderPosition); Device.ImmediateContext.Flush(); Device.ImmediateContext.OutputMerger.SetTargets(NullRTV); SetupBlend(false); //Set Render Target View Device.ImmediateContext.OutputMerger.SetTargets(SampleRenderView); // Set Viewport Device.ImmediateContext.Rasterizer.SetViewports(new Viewport(0, 0, WindowWidth, WindowHeight, 0.0f, 1.0f)); // Clear screen Device.ImmediateContext.ClearRenderTargetView(SampleRenderView, new Color4(1.0F, 0.0F, 0.0F, 0.0F)); if (Wireframe) { RenderWireframeBack(); Device.ImmediateContext.Rasterizer.State = RS_FRONT; } SetBuffers(); // Render Position Renderer.RayCasting101FX_WVP.SetMatrix(wvp); Renderer.RayCasting101FX_ScaleFactor.Set(ScaleFactor); Renderer.RayCasting101FX_Back.SetResource(new ShaderResourceView(Renderer.device, RearTexture));// RearTextureSRV); Renderer.RayCasting101FX_Front.SetResource(new ShaderResourceView(Renderer.device, FrontTexture));//FrontTextureSRV); Renderer.RayCasting101FX_Volume.SetResource(new ShaderResourceView(Renderer.device, Data.Texture)); Renderer.RayCasting101FX_StepSize.Set(StepSize); Renderer.RayCasting101FX_Iterations.Set(Iterations); Renderer.RayCasting101FX_Width.Set(DataWidth); Renderer.RayCasting101FX_Height.Set(DataHeight); Renderer.RayCasting101FX_Depth.Set(DataDepth); ExecuteTechnique(Renderer.RayCasting101FX_RayCastSimple); if (Wireframe) { RenderWireframeFront(); Device.ImmediateContext.Rasterizer.State = RS_FRONT; } int sourceSubresource; sourceSubresource = SlimDX.Direct3D11.Resource.CalculateSubresourceIndex(0, 1, 1);// MSAATexture.CalculateSubResourceIndex(0, 0, out sourceMipLevels); int destinationSubresource; destinationSubresource = SlimDX.Direct3D11.Resource.CalculateSubresourceIndex(0, 1, 1); //m_renderTarget.CalculateSubResourceIndex(0, 0, out destinationMipLevels); Device.ImmediateContext.ResolveSubresource(MSAATexture, 0, SharedTexture, 0, Format.B8G8R8A8_UNorm); Device.ImmediateContext.Flush(); CanvasInvalid = false; sw.Stop(); this.LastFrame = sw.ElapsedTicks / 10000.0; } private void PrepareRTV(RenderTargetView rtv) { //Set Depth Stencil and Render Target View Device.ImmediateContext.OutputMerger.SetTargets(rtv); // Set Viewport Device.ImmediateContext.Rasterizer.SetViewports(new Viewport(0, 0, WindowWidth, WindowHeight, 0.0f, 1.0f)); // Clear render target Device.ImmediateContext.ClearRenderTargetView(rtv, new Color4(1.0F, 0.0F, 0.0F, 0.0F)); } private void SetBuffers() { // Setup buffer info Device.ImmediateContext.InputAssembler.InputLayout = Renderer.RayCastVBLayout; Device.ImmediateContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList; Device.ImmediateContext.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(Renderer.VertexBuffer, Renderer.VertexPC.Stride, 0)); Device.ImmediateContext.InputAssembler.SetIndexBuffer(Renderer.IndexBuffer, Format.R32_UInt, 0); } private void ExecuteTechnique(EffectTechnique T) { for (int p = 0; p < T.Description.PassCount; p++) { T.GetPassByIndex(p).Apply(Device.ImmediateContext); Device.ImmediateContext.DrawIndexed(36, 0, 0); } } Finally, here's the shader in its entirety. The TrilinearSample function is supposed to compute a good, interpolated sample but is what ended up highlighting what the problem likely is. What it does, or at least attempts to do, is calculate the actual coordinate of the ray in the original grid coordinates, then use the decimal portion to do the interpolation. float4x4 World; float4x4 WorldViewProj; float4x4 WorldInvTrans; float3 StepSize; int Iterations; int Side; float4 ScaleFactor; int Width; int Height; int Depth; Texture2D<float3> Front; Texture2D<float3> Back; Texture3D<float1> Volume; SamplerState FrontSS = sampler_state { Texture = <Front>; Filter = MIN_MAG_MIP_POINT; AddressU = Border; // border sampling in U AddressV = Border; // border sampling in V BorderColor = float4(0, 0, 0, 0); // outside of border should be black }; SamplerState BackSS = sampler_state { Texture = <Back>; Filter = MIN_MAG_MIP_POINT; AddressU = Border; // border sampling in U AddressV = Border; // border sampling in V BorderColor = float4(0, 0, 0, 0); // outside of border should be black }; SamplerState VolumeSS = sampler_state { Texture = <Volume>; Filter = MIN_MAG_MIP_LINEAR; AddressU = Border; // border sampling in U AddressV = Border; // border sampling in V AddressW = Border; // border sampling in W BorderColor = float4(0, 0, 0, 0); // outside of border should be black }; struct VertexShaderInput { float3 Position : POSITION; float4 texC : COLOR; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float3 texC : TEXCOORD0; float4 pos : TEXCOORD1; }; VertexShaderOutput PositionVS(VertexShaderInput input) { VertexShaderOutput output; output.Position = float4(input.Position, 1.0); output.Position = mul(output.Position * ScaleFactor, WorldViewProj); output.texC = input.texC.xyz; output.pos = output.Position; return output; } float4 PositionPS(VertexShaderOutput input) : SV_TARGET // : COLOR0 { return float4(input.texC, 1.0f); } float4 WireFramePS(VertexShaderOutput input) : SV_TARGET // : COLOR0 { return float4(1.0f, .5f, 0.0f, .85f); } //draws the front or back positions, or the ray direction through the volume float4 DirectionPS(VertexShaderOutput input) : SV_TARGET // : COLOR0 { float2 texC = input.pos.xy /= input.pos.w; texC.x = 0.5f * texC.x + 0.5f; texC.y = -0.5f * texC.y + 0.5f; float3 front = Front.Sample(FrontSS, texC).rgb;// tex2D(FrontS, texC).rgb; float3 back = Back.Sample(BackSS, texC).rgb; // tex2D(BackS, texC).rgb; if(Side == 0) { float4 res = float4(front, 1.0f); return res; } if(Side == 1) { float4 res = float4(back, 1.0f); return res; } return float4(abs(back - front), 1.0f); } float TrilinearSample(float3 pos) { float X = pos.x * Width; float Y = pos.y * Height; float Z = pos.z * Depth; float iX = floor(X); float iY = floor(Y); float iZ = floor(Z); float iXn = iX + 1; float iYn = iY + 1; float iZn = iZ + 1; float XD = X - iX; float YD = Y - iY; float ZD = Z - iZ; float LL = lerp(Volume[float3(iX, iY, iZ)], Volume[float3(iX, iY, iZn)], ZD); float LR = lerp(Volume[float3(iXn, iY, iZ)], Volume[float3(iXn, iY, iZn)], ZD); float UL = lerp(Volume[float3(iX, iYn, iZ)], Volume[float3(iX, iYn, iZn)], ZD); float UR = lerp(Volume[float3(iXn, iYn, iZ)], Volume[float3(iXn, iYn, iZn)], ZD); float L = lerp(LL, UL, YD); float R = lerp(LR, UR, YD); //return ZD; return lerp(L, R, XD); return 0.0F; } float4 RayCastSimplePS(VertexShaderOutput input) : SV_TARGET // : COLOR0 { //calculate projective texture coordinates //used to project the front and back position textures onto the cube float2 texC = input.pos.xy /= input.pos.w; texC.x = 0.5f* texC.x + 0.5f; texC.y = -0.5f* texC.y + 0.5f; float3 front = Front.Sample(FrontSS, texC).rgb; // tex2D(FrontS, texC).xyz; float3 back = Back.Sample(BackSS, texC).rgb; // tex2D(BackS, texC).xyz; float3 dir = normalize(back - front); float4 pos = float4(front, 0); float4 dst = float4(0, 0, 0, 0); float4 src = 0; float value = 0; //Iterations = 1500; float3 Step = dir * StepSize; // / (float)Iterations; float3 TotalStep = float3(0, 0, 0); value = Volume.Sample(VolumeSS, pos.xyz).r; int i = 0; for(i = 0; i < Iterations; i++) { pos.w = 0; //value = Volume.SampleLevel(VolumeSS, pos.xyz, 0); value = TrilinearSample(pos.xyz); // tex3Dlod(VolumeS, pos).r; // Radar reflectivity related threshold values if (value < 40) value = 40; if (value > 60) value = 60; value = (value - 40.0) / 20.0; src = (float4)(value); src.a /= (Iterations / 50.0); //Front to back blending // dst.rgb = dst.rgb + (1 - dst.a) * src.a * src.rgb // dst.a = dst.a + (1 - dst.a) * src.a src.rgb *= src.a; dst = (1.0f - dst.a) * src + dst; //break from the loop when alpha gets high enough if (dst.a >= .95f) break; //advance the current position pos.xyz += Step; TotalStep += Step; //break if the position is greater than <1, 1, 1> if (pos.x > 1.0f || pos.y > 1.0f || pos.z > 1.0f || pos.x < 0.0f || pos.y < 0.0f || pos.z < 0.0f) break; } return dst; } technique11 RenderPosition { pass Pass1 { SetVertexShader(CompileShader(vs_4_0, PositionVS())); SetGeometryShader(NULL); SetPixelShader(CompileShader(ps_4_0, PositionPS())); //VertexShader = compile vs_2_0 PositionVS(); //PixelShader = compile ps_2_0 PositionPS(); } } technique11 RayCastDirection { pass Pass1 { SetVertexShader(CompileShader(vs_4_0, PositionVS())); SetGeometryShader(NULL); SetPixelShader(CompileShader(ps_4_0, DirectionPS())); //VertexShader = compile vs_2_0 PositionVS(); //PixelShader = compile ps_2_0 DirectionPS(); } } technique11 RayCastSimple { pass Pass1 { SetVertexShader(CompileShader(vs_4_0, PositionVS())); SetGeometryShader(NULL); SetPixelShader(CompileShader(ps_4_0, RayCastSimplePS())); //VertexShader = compile vs_3_0 PositionVS(); //PixelShader = compile ps_3_0 RayCastSimplePS(); } } technique11 WireFrame { pass Pass1 { SetVertexShader(CompileShader(vs_4_0, PositionVS())); SetGeometryShader(NULL); SetPixelShader(CompileShader(ps_4_0, WireFramePS())); //VertexShader = compile vs_2_0 PositionVS(); //PixelShader = compile ps_2_0 WireFramePS(); } } Any insight is hugely appreciated, whether on the specific problem or just random things I'm doing wrong. With the coordinates in the Texture3D being so messed up, I'm surprised this renders at all, let alone close to correctly. Thank you in advance!
  16. Hi there, I'm working on an web RPG. This is not and action RPG. The problem is I work full-time as a software developer and while I may get some code for the game done at work, I'm still a little short on time. So I'm looking for a second programmer to help me out. Please no beginners. I prefer working with someone who has built a full game (client, game server, web services, db) Requirements: Proficient in C# Proficient in .Net Core 2.X Experience with ASP.Net Core MVC Experience with ASP.Net Core Web API Experience with Unity 2018 Proficient in SQL and SQLite Proficient in EntityFramework Experience in AWS (RDS and EC2) Experience with IIS I'll handle the cost of any third-party services, domain names, etc. I'm just looking for a little help to get this game built in a reasonable amount of time. It will also be nice to bounce some ideas off each other. If you are interested, please send me an email: addictcodercs@gmail.com
  17. Hi there I'm working on a simple racing game at the moment that I like to pitch as Thumper vs. Burnout vs. Journey. In a nutshell it's a single player experience where the player races across a city in the dead of night with a time limit of one hour. The main mechanic being that driving well earns the ability to go faster, making things more challenging and opening up shortcuts and alternative routes, while mistakes (colliding with walls for example) make the player loses their highest speed and have to re-earn it. I have a grand vision for an a pounding, dynamic sound track with elements being added to the music as the player goes faster and I'm looking for someone to collaborate with on the audio effects. Here is a video of the early direction and feel of the project (it's moved on since, but this still gives a sense of the style): Contact me if you're interested in the opportunity to work on an interesting unique soundscape with me. Kind regards, Jamie
  18. Hello... This is my version of the Chapter 18 CLASS exercise about throwing and popping a bunch of balls. : NOTES : Random() For the most part as I worked through the exercise things became clear but I am still confused about "scope" or w/e it is called that determines when a variable is available to be read by other sections of the code. I wanted to use Random(); to build random numbers on the fly, but it seemed that I was either calling the random very quickly in succession, so all the results were identical, or I wasn't able to access the random object I created when I wanted to. I got around this problem by creating a custom random class called RAN. This initiated Random() during the creation of the class in the main program.. so that only happened once. Then it had functions to produce the random numbers I wanted, in the type I wanted. Also I found the code to be really ugly and hard to read if I just used Random(). I was using Bytes for my 0-255 colour codes.. and as far as I know Random() is returning only floats.. so every time I had to use Random() object I had to use Convert()... this lead to it being a mess. So I build into the RAN class in a way to choose the types for me to clean this up a little. This is only using Random() to for loop 5-50 times and make a list of balls with a size of 1-25 Random rand = new Random(); List<Ball> balls = new List<Ball>(); for (int i = 0; i < Convert.ToInt32(rand.Next(5, 50)); i++) { balls.Add(new Ball(Convert.ToInt32(rand.Next(1, 25)))); } The Colour class that was using bytes was even worse. balls[1].colour.red = Convert.ToByte(rand.Next(1, 255)); balls[1].colour.green = Convert.ToByte(rand.Next(1, 255)); balls[1].colour.blue = Convert.ToByte(rand.Next(1, 255)); And the BALL class was every worse worse!! Ball ball = new Ball(Convert.ToByte(rand.Next(1, 255)), Convert.ToByte(rand.Next(1, 255)), Convert.ToByte(rand.Next(1, 255)), Convert.ToInt32(rand.Next(1, 25)); I found it really strange that using Random() to get specific types would cause such ugly and bloated looking code. So I ended up making my own Random Class called Ran(). This would change the above code to.... Ran Ran = new Ran(); List<Ball> balls = new List<Ball>(); for (int i = 0; i < Ran.Int(5, 50); i++) { balls.Add(new Ball(Ran.Int(1, 25))); } balls[1].colour.red = Ran.Byte(); balls[1].colour.green = Ran.Byte(); balls[1].colour.blue = Ran.Byte(); Ball ball = new Ball(Ran.Byte(), Ran.Byte(), Ran.Byte(), Ran.Int(1, 25)); Which seems to me to be a zillion times easier to read. I has occurred to me now, while writing these notes on the lesson that I probably should have put the conversions into the BALL and COLOUR class themselves.. so it always takes a float in the constructor but stores it as a Byte.. or something like that.. but even doing that would change all the stuff like so.... Ran.Byte() -> random.Next(0,255) Ran.Int(1,25) -> ranomd.Next(1,25) I dunno.. even this looks worse than my custom thing I guess... it seems that there is something I may be missing here... as it seems ugly and hard to write. Maybe there is a better way to handle conversions instead of Convert.ToInt32 or w/e : NOTES : Code Comments I really need to start looking into making proper notes into my code. There should be a way using the ///sumemry type stuff to add ways to have VS use intense to show me what the members are expecting as I go. I will make a effort to comment more in my next one, but thought I would level this entire project with no comments.. just to see how little I understand it when I next look at it. C# Players Guide dose cover comments but after reading it a few times it is still confusing.. I need to source google page on this before next time. - THING TO DO. : NOTES : Possible Error I think there is a error in the main program, not a fatal one.. but I believe now I am going though it for my notes that I should have used <= instead of < for the for loops. As I am counting from 1 and not from 0. I will not bother fixing this.. but it is something to keep in mind. The 0 start in the Arrays and Lists is a little hard to remember. I think it is not an error though as I am using +1 in the readouts... but I am done for now and will not be checking or changing anything lol. It is time to move on. : CODE : Ball Class Colour Class Program Custom Random Class Exit Program Class : EXAMPLE OUTPUT : Well, see ya next time!
  19. Hi everybody ! We are an indie startup called Darkstar Games ! We are just creating our first game called Greater powers, a novel type medieval fantasy TCG MMORPG with which we use unity. We develop our games for Android, PC, iOS, and we have a software kit developer contract with Microsoft to adapt them to VR Microsoft HoloLens and VR Magic Leap in the future. We are developing our own alpha for the Kickstarter campaign at the moment ! So we are actively searching for motivated programmers willing to take place in our project to build the engine we are creating of our own right now ! The game is coded in C# and any unity experience is greatly appreciated! We collaborate to the startup worldwide remotely ! Programmers collaborating to the project such as building the alpha become shareholders and are hired in the start-up launch ! Here are some links about the project: https://www.artstation.com/floriangionnane https://www.facebook.com/DarkstarGamesCorp https://connect.unity.com/p/games-greater-powers If anyone interested, please send your resume to flosambora123@gmail.com Have a nice day !
  20. COMPANY AND THE PROJECT We are an indie game studio consisted of professional and skilled artists who are dedicated indie enthusiasts. Our current project is INT, developed on Unity Engine 5 for platforms Windows, Linux, and Mac. We are recruiting a few more members on the team to finalize our playable demo. INT is a 3D Sci-fi RPG with a strong emphasis on story, role playing, and innovative RPG features such as randomized companions. The focus is on the journey through a war-torn world with fast-paced combat against hordes of enemies. The player must accomplish quests like a traditional RPG, complete objectives, and meet lively crew members who will aid in the player's survival. Throughout the game you can side and complete missions through criminal cartels, and the two major combatants, the UCE and ACP, of the Interstellar Civil War. Please note that all of our current positions are remote work. You will not be required to travel. For more information about us, follow the links listed below. INT Official website IndieDB page Also follow social media platforms for the latest news regarding our projects. Facebook Twitter UNITY ENGINE PROGRAMMER We are looking for Unity Programmers. You will be working with our Coding team Lead to implement systems and mechanics using C# language. Your duties will include: Attendance of regular team meetings. Timely completion of implementation of assets. Direct contact with Project Lead and other Department Leads for the implementation process. Utilization of version control suites. Utilization of our project management boards (Trello) and communication channels to obtain up-to-date assets. REQUIREMENTS To be successful in this position, following requirements apply: Clear communication and self starter - pushes to meet deadlines and contribute to the project. Ability to complete tasks with limited input/direction from management. Comfortable with working with people remotely and via Trello management system. Good internet connection with ability to update assets/builds quickly, with large dependencies. At least 15 hours of availability each week. Proficient experience using the Unity Game Engine. Proficient experience in implementing assets into the Unity Game Engine. OTHER OPEN POSITIONS 3D Environment Modeller Website Manager 3D Character Modeller REVENUE - SHARE The project is marching increasingly closer to be ready for our crowd-funding campaign. Being an Indie team we do not have the creative restrictions often imposed by publishers or other third parties. We are extremely conscientious of our work and continuously uphold a high level of quality throughout our project. We are unable to offer wages or per-item payments at this time. However revenue-sharing from crowd-funding is offered to team members who contribute 15-20 hours per week to company projects, as well as maintain constant communication and adhere to deadlines. Your understanding is dearly appreciated TO APPLY Please send your Cover Letter, CV, Portfolio (if applicable), and other relevant documents/information to this email: JohnHR@int-game.net Thank you for your time! Please feel free to contact me via the email provided should you have any questions. We look forward to hearing from you! John Shen HR Lead Starboard Games LLC
  21. hello guys, i'm new in unity and i wanna make a ricing game , but i don't know how to start. The script of racing games in youtube is very bad how i wanna a better script but i don't know how and where to start , is any one here can help me ?
  22. You want to create custom meshes for your Unity3D UI, but you found the documentation lacking? In this article, I will describe How to implement a bare-essentials custom Unity UI mesh Point out all the pitfalls that leave you looking at invisible or non-existent meshes TL;DR To implement your own UI mesh, derive from MaskableGraphic and implement OnPopulateMesh(). Don’t forget to call SetVerticesDirty/SetMaterialDirty upon changes to texture or other editor-settable properties that influence your UI-elements and should trigger a re-rendering. Don’t forget to set the UIVertex’s color, otherwise, you won’t see anything due to alpha=0, i.e. full transparency. You can look at the full, minimal code example, here. Of Rendering Mini Maps Inside Unity UI My use case was simple: I wanted to create level previews for my current puzzle game project Puzzle Pelago, and I wanted to try making a simple tiling system based on a custom UI mesh. The requirements I was eyeing was that it should behave like all the other UI elements in unity, i.e. it should fit inside its RectTransform, it should work inside a masked ScrollView, and it should respond to disabled state tinting since it would be living inside of a button. What I ended up with looks something like this: The path there was not that bad, but still frustrating at times since all I found online was forum posts and Unity's own source code to go off of. So here I want to build a simplified example in which we will render a grid of textured quads inside a UI element, using one script. This should take all the hurdles for building any kind of (flat, 2d) UI geometry you might want to build. Unity Scene Setup Alright, let’s set up the scene as follows: Open the Unity project and Scene you want to work in. If there is no Canvas in the scene yet, create one! For this tutorial, I left all the properties at default. Inside the Canvas, create a ScrollView - we will want to check that our new UI component works inside of that! Inside the ScrollView > Viewport > Content, create new empty game object - let’s call it MyUiElement Add a CanvasRenderer component to the new game object, and then add new script: MyUiElement Open the new script in your favourite c# editor (I love Rider btw.), and go back to Unity’s scene. To make our lives easier, we will want to set the Scene View’s render mode to “Shaded Wireframe” so we can see our UI mesh geometry in detail. Also, it is useful to switch to the 2D view perspective, select our “MyUiElement” object and press F, so unity zooms in just right. Implementing the Custom Unity UI Mesh Script in C# Now we can go ahead and implement our new C# script! First off, our new script needs to at least derive from Graphic . But, if masking inside of ScrollViews, for example, needs to work, we better derive from MaskableGraphic. Otherwise, our graphics will render outside of the mask, too. Lol. Also, we want to be able to set the size of the grid cells in the editor, so we should add a public field for that. public class MyUiElement : MaskableGraphic { public float GridCellSize = 40f; Next, we want to be able to use a texture for our UI elements. Looking at Unity’s own implementation, e.g. that of the Graphic (source code) base class or the default Image (source code) UI element, we can see that a common pattern is to … … define Texture/Material slots as properties, such that when the texture is changed in the inspector, we can trigger Unity UI to re-render even while in edit mode. This is done by calling SetMaterialDirty() and SetVerticesDirty(). … implement mainTexture as a default overridden property such that if no texture is provided, we return the default white texture. [SerializeField] Texture m_Texture; // make it such that unity will trigger our ui element to redraw whenever we change the texture in the inspector public Texture texture { get { return m_Texture; } set { if (m_Texture == value) return; m_Texture = value; SetVerticesDirty(); SetMaterialDirty(); } } public override Texture mainTexture { get { return m_Texture == null ? s_WhiteTexture : m_Texture; } } Next, we have to override OnPopulateMesh() to do our rendering. It takes a useful little helper object for building meshes, the VertexHelper , as its argument. It tracks the vertex indices for you, and lets you add vertices, uvs and tris without having to do lots of array arithmetic and index tracking. It must be Clear()’ed before building a new mesh. I found it useful (and you may, too) to use a little quad-making helper function, AddQuad(): // helper to easily create quads for our ui mesh. You could make any triangle-based geometry other than quads, too! void AddQuad(VertexHelper vh, Vector2 corner1, Vector2 corner2, Vector2 uvCorner1, Vector2 uvCorner2) { var i = vh.currentVertCount; UIVertex vert = new UIVertex(); vert.color = this.color; // Do not forget to set this, otherwise vert.position = corner1; vert.uv0 = uvCorner1; vh.AddVert(vert); vert.position = new Vector2(corner2.x, corner1.y); vert.uv0 = new Vector2(uvCorner2.x, uvCorner1.y); vh.AddVert(vert); vert.position = corner2; vert.uv0 = uvCorner2; vh.AddVert(vert); vert.position = new Vector2(corner1.x, corner2.y); vert.uv0 = new Vector2(uvCorner1.x, uvCorner2.y); vh.AddVert(vert); vh.AddTriangle(i+0,i+2,i+1); vh.AddTriangle(i+3,i+2,i+0); } // actually update our mesh protected override void OnPopulateMesh(VertexHelper vh) { // Let's make sure we don't enter infinite loops if (GridCellSize <= 0) { GridCellSize = 1f; Debug.LogWarning("GridCellSize must be positive number. Setting to 1 to avoid problems."); } // Clear vertex helper to reset vertices, indices etc. vh.Clear(); // Bottom left corner of the full RectTransform of our UI element var bottomLeftCorner = new Vector2(0,0) - rectTransform.pivot; bottomLeftCorner.x *= rectTransform.rect.width; bottomLeftCorner.y *= rectTransform.rect.height; // Place as many square grid tiles as fit inside our UI RectTransform, at any given GridCellSize for (float x = 0; x < rectTransform.rect.width-GridCellSize; x += GridCellSize) { for (float y = 0; y < rectTransform.rect.height-GridCellSize; y += GridCellSize) { AddQuad(vh, bottomLeftCorner + x*Vector2.right + y*Vector2.up, bottomLeftCorner + (x+GridCellSize)*Vector2.right + (y+GridCellSize)*Vector2.up, Vector2.zero, Vector2.one); // UVs } } Debug.Log("Mesh was redrawn!"); } Note that in the AddQuad() function, we set position, uv, and color! Since in the UI material, texture is multiplied with the color by default. Leaving this at default, i.e. (r=0,g=0,b=0,a=0), this will yield 100% transparent material. So all you see is nothing, and if you are wondering why, this might be it. Here we use the component’s inherited color slot. Since we want our grid to update whenever the RectTransform is resized, we should also override OnRectTransformDimensionsChange(): protected override void OnRectTransformDimensionsChange() { base.OnRectTransformDimensionsChange(); SetVerticesDirty(); SetMaterialDirty(); } This should do. Now, back to our Unity scene, we should see a grid of white squares inside our RectTransform. To change this, we can select one of unity’s default textures in our texture slot. Adjusting the size of the RectTransform or the value of our Grid Cell Size, we can see that the grid updates automatically. Going into play mode, we should also be able to drag around the scroll view’s contents and have the grid be masked correctly. CONCLUSION You can have a look at the full code example, here . Of course, we are not limited to rendering quads, either, since the basic geometry we created here consist of triangles. So any 2D mesh should be possible to draw, and in principle, it could be animated, too! Anyway, if anything in my writeup is unclear, don’t hesitate to ask questions in the comments or via Twitter, @hallgrimgames. Good luck with your project! Note: This article was originally published on the Hallgrim Games blog, and is republished here with the kind permission of the author Christopher.
  23. So right now I am trying to figure out what my options are for building a game that at least will have a similar sandbox block presentation style that games like Terraria, Starbound, It Lurks Below, etc. have.The core parts that I am looking to achieve that related to the world are:- Relatively large map size (for example, I would like to support a map size that is the largest that Starbound has which I believe is 18 million blocks being 6000 x 3000)- Multiple layers of blocks (layer for the background, main world, vegetation, etc.)- Certain layers will support colliders, other won't (like the background really would not need a collider)- Dynamic lighting (similar to games mentioned above)- Falling blocks (like how sand works in Starbound)- 2D fluids (again similar to how it works in Starbound)- Dynamically growing blocks (like how vines can grow in Starbound)Currently I am prototyping with https://assetstore.unity.com/packages/templates/systems/terrain-engine-2d-115381 which is a promising solution and really the only asset I can find geared towards this exact style of game presentation however I want to have a fallback option in case for whatever reason I find that asset doesn't work in the end (at a minimum it will allow me to prototype a number of things quickly which is worth the price right there).If I find the asset above is not viable for everything I am going to want to do for the complete game, I don't mind having to some of the heavy lifting for the world management however there are 2 high level things that I do want any solution to provide:- manage the renderer of the blocks / tiles to the screen (I am fine managing the underlying "grid" of data the represents that world if needed)- manage the generation of the colliders dynamically (so when blocks are added / removed, the colliders are automatically updated)I think the rest of the things I would need to do I would be able to figure out is a reasonable time / am interested enough in them that researching them would not seem like too much of a chore (while I know developing a game as a solo developer I am going to have to do stuff that I don't necessarily find exciting / engaging but with this being a personal side project at the moment, I need to be able to limit that if I am going to finish this).Two options I can think of are:- Using a different tilemap solution: For example I have the Super Tilemap Editor asset that I used for a number of top down prototypes however most other tilemap assets seem to be geared towards top down (or at least that is what I see demo of for them), not sure if they would work for this kind of game.- Use Unity built-in tilemap solution as a base: Never used this so not sure how feasible it would be in using this as a based for my worlds in this kind of game.I would like to get people opinions of the above 2 options (maybe there is a different assets that I missed) or if people think I need a completely custom solution, I would like to hear the thoughts on why, thanks.
  24. Nilmani Gautam

    Cube Race : Unity 3D

  • Advertisement
×

Important Information

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

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

Sign me up!