Cheap Xbox Games

Mapgen4: river representation

 tháng 10 08, 2018     mapgen4, maps, project     No comments   


I've reached the point in mapgen4 development when I just want it to be over. So I'm cutting all remaining features and am focusing on finishing. Most of the remaining work isn't interesting enough to blog about so I'm going to describe the river representation I started using last year. It's worked very well for the needs of this project. Take a look at the rivers in this screenshot:





Rivers are binary trees





The map is represented as a dual mesh. There's a Voronoi region mesh that is drawn with the red points representing regions, blue points for vertices, and white edges for the polygons. There's also a Delaunay triangle mesh that is drawn with the blue points representing triangles, red points for vertices, and black edges for the triangles.





Dual mesh




I generate rivers on the Delaunay triangle mesh (more details in last year's blog post). As water flows downstream, two rivers can join together ("confluence") but one river never splits into two (there are exceptions in nature but not in my map generator). I assign each triangle to be one of five types:









(ocean)
0 children (leaf)
1 child (left)
1 child (right)
2 children




This creates a binary tree for each river. There are multiple rivers, so that makes a binary tree forest. A common representation of a binary tree is to use a node object that has pointers to a left child and right child, either of which could be null. That structure makes it easy to go from the parents to the children. It also makes it easy to insert and remove children. For the map generator I only have two passes over the tree structure, and I don't need to modify the tree.




  1. Construct the tree by starting from the coastlines and building rivers uphill. I start with the mouth of each river and go uphill, creating bends and forks until I end the tree with springs. This pass goes parent to child.

  2. Simulate rainfall by going the other direction. I start with the leaves and make water flow down to the parents, down through the tree until it reaches the coastline. This pass goes child to parent.




Consider this example river tree of triangles (drawn with graphviz) that flow down to the coastline at triangle 15:





Binary tree representing a river





For this I can use an array representation. During the construction phase, I append to the array, writing the triangle IDs in breadth first search order:











































012345678910111213
15923411872358051754518748





The child nodes are always after the parent nodes. For example, in the tree, node 80 is a child of node 41, and in the array, node 80 at position 7 is after node 41 at position 3.




I also need a map from child node ID to parent node ID:









































from923411872358051754518748
to1515923234141727280175454





During the simulation phase, I traverse the array in reverse order. I first set the river flow to 0 everywhere. Then for each node:




  1. Calculate the rainfall r

  2. Increment the current node's river flow f by r

  3. Find the parent node in the parent array, and increment the parent's river flow by f




For example, when visiting position 7, I would calculate the rainfall at node 80, add that to 80's river flow, see 80's parent is 41, and add 80's river flow to 41's river flow.




The standard representation of binary trees stores children at each node; I instead needed to know the parent of each node. I'm using an array of integer representation instead of the usual tree of objects representation. I mostly picked this to avoid memory allocations — I can allocate it when the program starts and then reuse the array — but it may also be slightly more cache friendly.




I'm pretty happy with the way the rivers work right now. One additional step I considered was to iterate forwards and backwards in the array again to make canyons look nicer. Right now there aren't that many canyons and I don't want to slow things down so I'm going to skip this for now.




I want to finish this project soon so I'm declaring feature freeze. I am going to fix bugs and add UI for things that currently require editing the code. I'd like to improve performance but that can wait. I'd like to improve the visuals but that can wait too.

  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Gửi email bài đăng nàyBlogThis!Chia sẻ lên XChia sẻ lên Facebook
Bài đăng Mới hơn Bài đăng Cũ hơn Trang chủ

0 nhận xét:

Đăng nhận xét

Popular Posts

  • Games Design and Games programming students team up.
    Our Games design students collaborating with web design coding students @JAMUCLAN . Coding Tutor Mark Porter and Design tutor, Bev Bush brou...
  • Hexoshi - inspired by Metroid
    Hexoshi ( forum thread ) is a libre game generally inspired by the Metroid series, notably the older versions. It is seeking funding using ...
  • Cara Klaim PS+ 14 Hari Secara Gratis (new trick 2019)
    Sebuah trick yang saya coba beberapa hari yang lalu, saya menggunakan trick ini untuk mengklaim game gratisan PS+ Region 2 karena di region...
  • Introduction to TiltBrush by Google.
    My first experience of drawing with Tiltbrush with the Vive headset was exciting as it felt like a very new experience.   We also arranged...
  • White Paper Games launch 'The Occupation' at EGX Rezzed 2017.
    White Paper Games are showing their new game 'The Occupation' at EGX Rezzed this week, March 2017. See the trailer here : Check out...
  • Marco Carmo is Games Design Nominee for Lancs Arts festival 2018
    Many congratulations to  Marco Carmo  who is our Nominee for Games Design in the Media Tech Lancashire Arts Festival Awards 2018.  #lancsart...
  • Review Indie Game: Sigi - A Fart for Melusina (PS4)
    Sigi - A Fart for Melusina merupakan sebuah game 2D plat former adventure buatan dari  pixel.lu , game ini bercerita kan tentang petualanga...
  • Review Indie Game: FullBlast (PS4)
    FullBlast , merupakan sebuah game indie pesawat arcade developer dari Ratalaika Games , Game yang cukup menarik, dan saat memainkan nya kita...
  • Posting iseng Out of Box
    Iseng-iseng posting out of box aja, setelah coba searching di youtube dengan key "Kenapa Harus ASUS ROG?" ternyata banyak juga vid...
  • Examples of work by UCLan first year Games Design students.

OpenGameArt Summer Game Jam #3 has begun

One of our affiliate websites OpenGameArt (OGA), a free repository for public domain and copyleft licensed art, has just begun hosting this...

Tìm kiếm Blog này

Được tạo bởi Blogger.

Lưu trữ Blog

  • tháng 7 2019 (1)
  • tháng 6 2019 (11)
  • tháng 5 2019 (7)
  • tháng 4 2019 (10)
  • tháng 3 2019 (7)
  • tháng 2 2019 (14)
  • tháng 1 2019 (16)
  • tháng 12 2018 (20)
  • tháng 11 2018 (14)
  • tháng 10 2018 (12)
  • tháng 9 2018 (25)
  • tháng 8 2018 (6)
  • tháng 7 2018 (5)
  • tháng 6 2018 (10)
  • tháng 5 2018 (12)
  • tháng 4 2018 (33)
  • tháng 3 2018 (5)
  • tháng 2 2018 (10)
  • tháng 1 2018 (25)
  • tháng 12 2017 (5)
  • tháng 11 2017 (5)
  • tháng 10 2017 (2)
  • tháng 9 2017 (6)
  • tháng 8 2017 (3)
  • tháng 7 2017 (8)
  • tháng 6 2017 (13)
  • tháng 5 2017 (12)
  • tháng 4 2017 (17)
  • tháng 3 2017 (14)
  • tháng 2 2017 (10)
  • tháng 1 2017 (9)
  • tháng 12 2016 (3)
  • tháng 11 2016 (13)
  • tháng 10 2016 (14)
  • tháng 9 2016 (3)
  • tháng 7 2016 (3)
  • tháng 6 2016 (5)
  • tháng 5 2016 (1)
  • tháng 4 2016 (8)
  • tháng 3 2016 (2)
  • tháng 2 2016 (3)
  • tháng 1 2016 (3)
  • tháng 12 2015 (5)
  • tháng 11 2015 (8)
  • tháng 10 2015 (2)
  • tháng 9 2015 (5)
  • tháng 8 2015 (3)
  • tháng 7 2015 (2)
  • tháng 6 2015 (2)
  • tháng 5 2015 (6)
  • tháng 4 2015 (6)
  • tháng 3 2015 (5)
  • tháng 2 2015 (4)
  • tháng 1 2015 (4)
  • tháng 12 2014 (4)
  • tháng 11 2014 (4)
  • tháng 10 2014 (5)
  • tháng 9 2014 (5)
  • tháng 8 2014 (4)
  • tháng 7 2014 (8)
  • tháng 6 2014 (9)
  • tháng 5 2014 (4)
  • tháng 4 2014 (6)
  • tháng 3 2014 (8)
  • tháng 2 2014 (5)
  • tháng 1 2014 (8)
  • tháng 12 2013 (8)
  • tháng 11 2013 (8)
  • tháng 10 2013 (9)
  • tháng 9 2013 (11)
  • tháng 8 2013 (8)
  • tháng 7 2013 (7)
  • tháng 6 2013 (10)
  • tháng 5 2013 (12)
  • tháng 4 2013 (14)
  • tháng 3 2013 (8)
  • tháng 2 2013 (3)
  • tháng 1 2013 (2)
  • tháng 7 2012 (2)
  • tháng 6 2012 (1)
  • tháng 5 2012 (1)
  • tháng 4 2012 (1)
  • tháng 2 2012 (1)
  • tháng 1 2012 (2)
  • tháng 12 2011 (1)
  • tháng 10 2011 (1)
  • tháng 9 2010 (3)
  • tháng 8 2010 (1)
  • tháng 6 2010 (1)
  • tháng 4 2010 (1)
  • tháng 2 2010 (1)
  • tháng 1 2010 (1)
  • tháng 11 2009 (1)
  • tháng 8 2009 (1)
  • tháng 7 2009 (1)
  • tháng 6 2009 (3)
  • tháng 5 2009 (3)
  • tháng 4 2009 (1)
  • tháng 3 2009 (2)
  • tháng 1 2009 (3)
  • tháng 12 2008 (1)
  • tháng 11 2008 (2)
  • tháng 8 2008 (1)
  • tháng 6 2008 (2)
  • tháng 2 2008 (2)
  • tháng 11 2007 (1)
  • tháng 7 2007 (1)
  • tháng 6 2007 (2)
  • tháng 4 2007 (1)
  • tháng 3 2007 (1)
  • tháng 2 2007 (1)

Nhãn

  • ‘Drawing for Games’ session!
  • 'Plinky Plonk' version 2 is out!
  • #DS16 Uclan Games Design Private view.
  • #UCLanCF - MA Show
  • 0ad
  • 14 Uclan Games Design Alumni are credited on Lego Starwars Force Awakens.
  • 2d
  • 2x0ng
  • 3D
  • 3rd Year student
  • 9-Bit Idol pitch for Dare To Be Digita
  • A Grand Day Out with UCLan Games Design.
  • a las barricadas
  • A very Merry Christmas to you all
  • AAA Game Review
  • Action Games
  • Adam Mattis.
  • Adventure Games
  • alienarena
  • Alpha Texturing
  • ALUMNI GAMES DESIGNERS HAVE ‘THE FORCE’
  • Alumni Robin Willians work results in demand for GTA vehicle.
  • Alumni Sian Knight begins job with Fat Fraken Studios.
  • ancientbeast
  • Andy Gahan
  • Andy Wood of Double Fine Productions QA Session
  • annex-glest-mod
  • antargis
  • arcade
  • arewealone
  • art
  • Arthur Parsons
  • Arthur Parsons of TTGames awarded an Honorary Fellowship from Uclan
  • Arthur Parsons visit to Uclan Games Design Course 2017
  • article
  • arxendofsun
  • arxliberatis
  • assaultcube
  • Athletic achievements by Uclan Games Design student
  • AtomicGameEngine
  • Augsburg University of Applied Sciences visit to Uclan
  • award
  • BA Games Design at UCLan
  • BA(Hons) Games Design at Uclan.
  • BA(Hons) Games Design UCLan Graduates
  • Bajakan
  • ball-rolling
  • Bank BTN
  • Berita
  • Best Game Award at Uclan Games Jam 2016 .
  • bge
  • BIG CONGRATULATIONS to WHITEPAPERGAMES
  • Blackvoxel
  • blender
  • bombable
  • bos
  • bos-wars
  • boswars
  • BugBox- visual programming experiment.
  • bullet
  • bushidoblocks
  • bygfoot
  • canvas
  • cataclysm
  • Chocolate Doom
  • codecombat
  • commercial
  • community
  • competition
  • Computer
  • conquests
  • contest-gamedev
  • corebreach
  • Crates and Barrels
  • creativecommons
  • Crosby Game WIP
  • crowdfunding
  • crowdsourcing
  • crystalspace
  • Cube2
  • cytopia
  • Dan Bavin starts new job at Ninja Theory
  • Dan Bavin wins Creative Focus Award for Design 2015
  • darkmod
  • darkplaces
  • data dealer
  • deadmorning
  • Debut
  • deceiver
  • design
  • Design Director at Travellers Tales
  • devcorner
  • dhewm3
  • Diablo
  • Digital
  • Doom
  • Doom3
  • Double presentation by Alumni for UCLan Games Design
  • duckmarines
  • eatthewhistle
  • ecksdee
  • emiliapinball
  • emscripten
  • Emulator
  • Engine
  • engines
  • erebus
  • escoria
  • European Women in Games Conference 2016
  • Even more recent graduates now working in the Games industry
  • event-conference
  • Excellent NSS Uni Stats for Uclan BA(Hons) Games Design.
  • extremetuxracer
  • FGD
  • Fighting Games
  • Finale of the Games Design Degree Show
  • Finalist in 'Break Through Talent' Award.
  • First week of Uclan Games Jam 2015
  • First Year Games Design Students make games at UCLan
  • First year project examples
  • flare
  • flash
  • flightgear
  • Fraud
  • Freeablo
  • freedink
  • freegamer
  • freeorion
  • freesound
  • Freshers Games Design Challenge 2018
  • frogatto
  • FS-UAE
  • Further good news for UCLAN 3rd year student
  • future
  • Gagal
  • Game
  • Game by Nellie Sandblom as published on Scirra Arcade.
  • game engine
  • GameDevelop
  • Games
  • Games Course Alumni Postcards
  • Games Design and Games programming students team up.
  • Games Design course visit from Concept Games Artist
  • Games Design day of Speakers from industry.
  • Games design first years using 'actual' Ether-One assets.
  • Games Design Graduation ceremony 2018
  • Games Design students at the Harris.
  • Games Guru
  • Games student chosen for Noise Festival
  • Games students visit Blackpool Zoo and Tower
  • Gatget Review
  • genre-adventure
  • genre-buildingsim
  • genre-cards
  • genre-educational
  • genre-engine
  • genre-exploration
  • genre-flighsim
  • genre-fps
  • genre-mmo
  • genre-platformer
  • genre-precision
  • genre-puzzle
  • genre-racing
  • genre-roguelike
  • genre-rpg
  • genre-rts
  • genre-sandbox
  • genre-shooter
  • genre-space
  • genre-stealth
  • genre-tbs
  • geometry
  • gigalomania
  • Girls design games @jamuclan
  • glamour
  • GLSL
  • godot
  • Gorynlich
  • Grads In Games visit to UCLAN for the Get in the Game Careers Talk Tour
  • Graduate success
  • graphics
  • Gratis
  • grids
  • gsoc
  • h-craft
  • Hand Painted texturing
  • Hardware
  • haxe
  • HDD
  • hedgewars
  • hero of allacrost
  • hexagons
  • hexenedgeofchaos
  • hexoshi
  • Horror Games
  • html5
  • http://gamescourse.blogspot.co.uk/2017/03/ba-games-design-at-uclan.html
  • https://www.uclan.ac.uk/about_us/case_studies/game-jam-2018.php
  • ideas
  • idtech2
  • idtech3
  • idtech4
  • Indie Games Review
  • indiegogo
  • Induction week for BA(Hons) Games Design Uclan.
  • Info Handheld 3DS
  • Info PS4
  • Info TV
  • infrastructure
  • International Women's Day celebration
  • Introducing Pinterest to students as a visual research tool
  • Introduction to PanoPainter.
  • Introduction to TiltBrush by Google.
  • ioquake3
  • ironbane
  • irrlamb
  • irrlicht
  • James Burton - MA Games Design - UCLan
  • jediknight
  • jme
  • jmonkey3
  • jrpg
  • Jual
  • keeperrl
  • Knowledge
  • language
  • Lego Game Design Live brief
  • licensing
  • lincityng
  • linux
  • linuxgameawards
  • lipsofsuna
  • Live Stream on Twitch TV.
  • love
  • löve
  • löve2d
  • lugaru
  • MA Design Degree Show - UCLan. Featuring our MA Games Design students!
  • MA Games Design Show at Uclan 2013
  • mac
  • making-of
  • Mandiri
  • mapgen4
  • maps
  • Marco Carmo is Games Design Nominee for Lancs Arts festival 2018
  • math
  • MCV talk to the finalists ahead of this year’s Women in Games Awards.
  • Meet the Developer - Steven Thornton
  • Meet the Developer. Stephen Morris of Greenfly Studios
  • MegaGlest
  • MIT
  • mode-multiplayer
  • mode-onedevicemultiplayer
  • mode-singleplayer
  • Moonshades
  • More robot games designed by Year 1 Uclan Games design students
  • More Top-down shooter games- designed by year 1 Uclan students.
  • More Uclan Games Graduates from class of 2017 now have jobs!
  • Movie Review
  • My Story
  • Mystery
  • naev
  • neverball
  • New Games Design Students arrive for Induction week
  • Nik Hughes. Realtime Job Update
  • Nintendo Switch
  • noise
  • Nominated for Develop Award
  • nova pinball
  • occulusrift
  • oceansheart
  • octaforge
  • ogre3d
  • olpc
  • open-source
  • openart
  • opencaesar3
  • opencity
  • opendungeons
  • openflashpoint
  • openfootball
  • opengameart
  • openig
  • openjk
  • openmw
  • openra
  • openxcom
  • osx
  • overdose
  • ows
  • pathfinding
  • patreon
  • Pete Bottomley to talk at GDC 2015
  • Peter Dimitrov makes his mark.
  • Peter Dimitrov.
  • Peter Field - Games Designer at Naughty Dog
  • Peter Field from 'Media Molecule' visits Uclan Games design
  • Peter Field of Media Molecule visits Uclan Games Design
  • pinball
  • pixel art
  • Platform Games created by Year 1 Games Design students @UclanCF
  • platform-android
  • platform-handheld
  • platform-html5
  • platform-linux
  • platform-osx
  • platform-webgl
  • platform-windows
  • Playful ideas by Bev Bush - try them on GameJolt.
  • pleethebear
  • Plinky Plonk Xmas App is live
  • Portable Console
  • portrait-marathon
  • PotM
  • power
  • programming
  • project
  • projectfootball
  • projectofthemonth
  • PS Plus
  • PS+
  • PS4
  • PS4 Bajakan
  • PS4 Original
  • PS5
  • PSN Store
  • Puzzle Games
  • racer
  • racing
  • Racing Games
  • ransom
  • Recent Graduate employed as a Games Designer
  • Recent Uclan Games Design Graduates now in work!
  • redeclipse
  • retro
  • retro games
  • retux
  • Review
  • roguerepublic
  • Role-Playing Games
  • ROTC
  • rpg
  • rts
  • Rumor dan isu
  • ryzom
  • Saija Sipila interviewed on Linkedin.
  • Sarah Akers and Will Butterworth visit Uclan Games Design
  • scifi
  • SDD
  • sdl
  • Secret Santa day for Uclan Games Design
  • Shaun Mooney
  • Shooting Games
  • Siân Knight
  • Simulation Games
  • sintel
  • sintelthegame
  • solarus
  • Some of our UCLan Games Design Success Stories.
  • space station 13
  • spacenerdsinspace
  • Spider Man
  • Sports Games
  • SSD
  • standalone
  • Stealth Games
  • steam
  • strategy
  • Strategy Games
  • Strife
  • structure
  • Student Hero Nomination for James Moorby
  • stuntrally
  • style-historical
  • style-retro
  • style-sci-fi
  • summerofcards
  • superpowers
  • supertuxkart
  • Survival Games
  • systemshock
  • Tales of Maj'Eyal
  • TBS
  • td
  • terminal-overload
  • Terra Centauri
  • Tesseract
  • The Castle Doctrine
  • The Great Northern Creative Festival
  • The Great Northern Creative Festival Games Event.
  • The Great Northern Expo award for Games Design 2108
  • The Great Northern Festival - Games Design UCLan
  • The Impact of Play in Society.
  • THE NORTHERN FESTIVAL AWARDS
  • theskyofverdun
  • theyearning
  • Three more Games course Alumni Posters
  • Tips and Trick PS4
  • tobutobugirl
  • tol
  • ToME
  • Top Down Shooter Bugs
  • Top Down Shooter BUGS!
  • torque2d
  • torque3d
  • tournament
  • towerdefense
  • tremulous
  • triangles
  • Trip and Trick PS4
  • tutorial
  • UCLan Alumni selected as part of BAFTA Games Crew.
  • UCLan Alumni Steph McStea named in the 100 rising stars of the UK games industry.
  • Uclan BA(Hons) Games Design Book
  • Uclan Game Jam 2015
  • UCLan Game Jam 2017
  • UCLan Games Alumni 'White Paper Games' featured in both Edge and Games TM Magazines.
  • Uclan Games Design - Night of the Private View 2014
  • UCLan Games Design Alumni
  • Uclan Games Design Alumni are amongst the best at EGX 2017
  • Uclan Games Design Christmas Party 2018.
  • UCLan Games Design Course trip to EGX 2018
  • Uclan Games Design Degree Show 2013
  • Uclan Games Design degree show 2014
  • UCLan Games Design Degree Show 2018
  • UCLan Games Design Degree Show 2019
  • Uclan Games Design Easter Quiz
  • UCLan games design groups present Lego game ideas.
  • Uclan Games Design Induction week 2014
  • Uclan Games Design Second Year student showcase 2014
  • Uclan Games Design Student
  • Uclan Games Design students in Global Game Jam
  • Uclan Games Design visit EUROGAMER 2015
  • Uclan Games Grad Steph McStea is now...
  • Uclan Games Jam 2016 Finale and Awards
  • Uclan Games Student designs Summer Reading Scheme characters for The SCART Club
  • UCLan Games Student enters Rookies Competition 2019
  • Uclan Games students working with 'Soccer Manager'.
  • UCLan Global Game Jam 2016
  • Uclan Groups present GAME JAM concepts
  • Uclan Lecturer
  • Uclan's Games Design Alumni
  • Ukie team on the UK pavilion at Gamescom
  • unvanquished
  • UPS
  • Urho3D
  • valyriatear
  • vdrift
  • vdrift-ogre
  • veraball
  • video
  • video games
  • Views of Preston created by Uclan Games Design Students
  • Visit from Tom Kewell of Foundry 42
  • Visit to Uclan Games Design by Joe Nelson
  • visits Uclan Games Design course
  • voadi
  • voronoi
  • vote
  • voxel
  • vue
  • Warner Bros. visits Uclan
  • warsow
  • warzone2100
  • wesnoth
  • White Paper Games launch 'The Occupation.
  • White Paper Games launch 'The Occupation' at EGX Rezzed 2017.
  • WhitePaper Games QA session with Uclan Games Course
  • windows
  • worldforge
  • wtactics
  • WTS
  • Wurmsyn
  • wyrmsun
  • xonotic
  • ya3dag
  • Year 1 Games Design student completes timelapse concept art film.
  • yodasoccer
  • ysoccer
  • zelda
  • zero-k

Báo cáo vi phạm

Giới thiệu về tôi

Admin
Xem hồ sơ hoàn chỉnh của tôi

Copyright © Cheap Xbox Games | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates