Menu
Learn
Documentation
Language Reference
Library Reference
Command-line Reference
Feature Overview
Articles
Downloads
Packages
Community
Blog
Orgs using D
Twitter
Calendar
Forums
IRC
Wiki
GitHub
Issues
Get involved
Contributors
Foundation
Donate
Sponsors
Resources
Tour
Books
Tutorials
Tools
Editors
IDEs
Visual D
Acknowledgments
D Style
Glossary
Sitemap
Search
Entire Site
Language
Library
Forums
Learn group
This thread
go
Forums
Forums
Forum Index
New users
Learn
Community
General
Announce
Improvements
DIP Ideas
DIP Devel.
Ecosystem
GDC
LDC
Debuggers
IDEs
DWT
Development
Internals
Issues
Beta
DMD
Phobos
Druntime
Study
Turkish
Genel
Duyuru
Log in
Settings
Help
Index
»
Learn
»
Nobody understands templates?
»
Post reply
Warning: the post you are replying to is from 11 years ago (March 05, 2014).
Posting to
Learn
in reply to
Nick Sabalausky
Your name:
Your email address (
?
):
Subject:
Message:
On Wednesday, 5 March 2014 at 01:16:37 UTC, Nick Sabalausky wrote: > On 3/4/2014 7:42 PM, bearophile wrote: >> Nick Sabalausky: >> >>> - Lumping all data/functionality for a single "object" >>> instance into >>> the same physical chunk of memory causes problems for >>> parallelization. >>> And that's increasingly problematic on modern processors >>> which work >>> best when operating as "streaming-data processors". (See >>> "Entity/Component Systems"[1] - There are good reasons >>> videogame >>> development has mostly switched from OOP to entity/component >>> systems.) >> >> Sometimes OOP is handy, for GUIs and other situations, but if >> today a >> more horizontal placement of fields is more efficient when high >> performance is needed, then perhaps a creative programmer has >> to find >> the courage to step out of his/her/hir language constraints to >> invent a >> better language. Is it possible to invent a language more fit >> for this >> different kind of data layout? >> > > I don't think it's necessary to go as far as creating a new > language. An entity-system in a low-level-capable language > gives you enough power to control layouts however appropriate, > and using them is pretty easy. > > It seems intimidating at first, but it's really just like a > relational DB: You have a unique ident for each "object" (ie, > what an OO system would call an instantiated object, but in > this case called an "entity"). And then all the data associated > with the "object/entity" is stored in various > tables/structs/whatever (in this case, called "components") > with the entity's unique identifier being the primary key for > each table/component. Functionality operates on a particular > table/component, or a set of specific tables/components, either > on a row-at-a-time basis or as the whole table as an aggregate. > > Note that this imposes very little, if any, requirements on > in-memory layouts, so things can be laid out however desired - > possibly even with per-platform topologies thanks to the magic > of metaprogramming. In any case, metaprogramming can help > abstract away many of the internal memory-layout details. > > Playing around with the Unity3D editor, and it's tutorial > videos, can help grok the usage and modeling power of entities > (like any good modern game engine, it uses an entity-based > design). Although, FWIW, I'm not convinced Unity3D's design is > able to *fully* take advantage of all the potential performance > benefits of an entity system (mostly because of its CLR-based > scripting and black-box closed-source engine). > > But, I admit, I have wondered if a language could aid the > creation/usage of entity systems with some special language > features.
Enable
Markdown
Copyright © 1999-2021 by the
D Language Foundation