M
M
Mukhiddin Makhmudov2018-01-11 23:28:54
Game development
Mukhiddin Makhmudov, 2018-01-11 23:28:54

The disease of the creator or how to create your own virtual world?

Welcome to my period of life, in which I finally decided to take on my old dream. The disease of the creator, or how to create your own virtual matrix, has been in my head for exactly as long as I can remember. And now, after so many delayed attempts, having gained a lot of knowledge and experience, I am glad that I take this matter seriously.
My Knowledge:

  • HTML, CSS
  • Javascript, Jquery, Ajax
  • PHP, OOP
  • MySQL
  • Laravel Framework

5a57b5fa7c1db099734299.jpeg
I'll get to the point. I want to create a huge virtual city, from the Middle Ages, which will live its own life, regardless of me. I can’t afford 3D graphics, because for now everything will be in the form of ordinary graphs and numbers, in the future I will come up with a visual shell for all this.
The city will have small neighborhoods in which it is necessary to realize the growth of vegetation and the activity of some fauna. When mining, hunting, the balance must be calculated in order to exclude infinite resources.
To begin with, I will give birth to 1000 inhabitants. Everyone should have their own daily routine, position on the map, financial transactions, extraction and expenditure of resources. I will implement a script for unforeseen circumstances in the form of relationships, weddings, illnesses, births, desires and so on.
The economy will also be an important part of the implementation. Prices for goods and services will be set according to demand and quantity. I think it is not worth specifying that production is also in the hands of residents.
So questions
First of all, I need absolutely any information that can help me. I will be very grateful if you direct me on what to study and what will be useful for realizing this goal.
Question- Since my city can be divided according to logical calculations into the economy, the behavior of the inhabitants, the growth and activity of the fauna, and so on, I'm wondering if I should separate these processes into different servers. One server will calculate the growth of trees, the movement of deer through forests, the number of fish in lakes, while the other server is busy calculating the economy. There will be some intermediate server that will collect information from the servers and transfer it to the user. What do you think about this? And how would you implement communication between these servers?
Question - As you know, there is one problem with scripting languages ​​like PHP, they die immediately after execution. And I need something that will work constantly and do constant computing. The first thing that comes to my mind is CRON. What do you recommend?

Answer the question

In order to leave comments, you need to log in

14 answer(s)
S
santaatnas, 2018-01-12
@santaatnas

You are inventing some nonsense on php to do this)). Unity + С# and forward)) You can do it under VR. Any logic, any code, AI and everything else + interfaces are free, a lot of models out of the box. You will understand C#, it is also OOP like php.

S
sim3x, 2018-01-12
@sim3x

will live his life regardless of me
yeah, he'll make his own coffee. That doesn't happen. It will take balancing and many simulation runs to understand how to make a stable environment that will be interesting to change for the user.
I can't afford 3D graphics
look for emerging artists
in the form of regular graphs and numbers
even harder to come up with
The city will have small neighborhoods in which it is necessary to realize the growth of vegetation and the activity of some fauna.
and how will it be simulated? Are there already ratios for how many trees and living creatures need to be grown per tick?
When mining, hunting, the balance must be calculated in order to exclude infinite resources.
yeah, and then everyone will starve to death or everyone will be filled with foxes
. You should start by creating your own version of the Life game.
There you will understand what the essence and problems of your idea are.
Immediately decide how the players will interact with each other and whether
there will be several servers. no resources are required (unless you write garbage instead of code)
A framework will not help much in this task, unless you can design everything so that validations and saving pass through it

X
xCyber, 2018-01-12
​​@xCyber

The history of one artificial virtual world: https://geektimes.ru/post/90571/
You can implement it on javascript and canvas
5a58717ee25db142273485.png

S
Saboteur, 2018-01-11
@saboteur_kiev

1. You can not bother with graphics at all, get by with text at first.
2. Yes, it is quite possible to separate processes into different services. Communication can be done through a database or any kind of interprocessor communication, the same sockets.
The main thing is to share correctly.
Ideally, so that the stop of one of the processes does not interfere with the lives of the others - the server serving AI has fallen, the monsters have disappeared. But the world itself, grass, resources are in place, and users can run. This is how it is implemented in the same Linage from NCSoft.
3. If you have logic ready and described, then highly loaded algorithms can be written in C ++, java, go, or any other language.
If you are going to monetize it all - this is one thing. Just release a working good version, bring it to mind and try. If it takes off, it will always be possible to hire programmers, rewrite individual processes from scratch (if there is a technical specification and well-described logic) in a compiled language.

I
iki90009, 2018-01-13
@iki90009

Look towards the game Dwarf Fortless
This is the best example of what you are asking for. Read the game's wiki.
This man has been writing dwarven adventures for years.

L
LaitVersion, 2018-01-12
@LaitVersion

As you know, there is one problem with scripting languages ​​like PHP, they die immediately after execution - not always https://www.google.ru/search?q=php+daemon&oq=php+de
... I need these processes on different servers - there is no point in this, at least at the initial stages of development, IMHO
How would you implement communication between these servers? - I think it's not worth reinventing the wheel here, it will be enough to use the database
. And I need something that will work constantly and do constant calculations. The first thing that comes to my mind is CRON - it's either a cron or a demon, there doesn't seem to be any other .. at least I don't know
And so, in my opinion, php is not suitable for such tasks, IMHO something serious cannot be written, in my opinion, a simple text game at most.
In the future, I will come up with a visual shell for all this - what is meant by this? If it's 3d, then I'll tell you a disastrous thing right away.
I sum it up! The idea is pointless and there will be 0 benefits from it, better study Unity or Unreal Engine and plunge headlong into game dev if you really want to create something more or less interesting.
PS I am not an expert in any areas, but I express my subjective opinion, which may be erroneous

A
AnotherStar, 2018-01-12
@AnotherStar

I would start such a project for myself with a static canvas page, on which each pixel is a unit of coordinates (top view). On JavaScipt, you can write a class for trees, with approximately the following set of functions: grows, depending on the time of year (day) multiplies (scatters seeds).
In this case, we get an infinitely reproducing system in which it is necessary to create a limiting factor: longevity and a renewable resource (water) and space to grow (short trees do not have enough sunlight). Already these three factors of influence are enough to see how the ecosystem works, to select constants (or rather, ranges of random variables) in which the system lives.
Thus, a certain natural selection will appear, within which it will be possible to see a clear predominance of large over small, and so on
. often your idea will have to be bypassed with hardcode and hacks.

G
Griboks, 2018-01-11
@Griboks

Google "how to make an rpg", "how to write AI for an rpg", "how to make games", "math modeling". Based on this, you begin to build your world (from architecture). You understand that you cannot do it, you give up. After a while, you return to work, having rewritten half of the code. And so it will be repeated indefinitely, until you write yourself TK. Without TK, your world will never be finished, because your brain will come up with new chips, while implementing the previous ones. Thus, you will not be able to satisfy yourself in the near future.
Once you make a game, sell it to an email.
And you should not separate everything by servers. In general, you should not really reproduce all the actions. I/O is paramount.

C
CityCat4, 2018-01-12
@CityCat4

There is no need to immediately rush to choose a nuclear program, a base, and so on. First, you need to describe the mechanics of interaction of all this with each other down to the most details - from above, from large modules to the very bottom, where the probability is calculated that a couple of units will have a boy or a girl :)
Without such a description, you will constantly get confused - because that the size of the project is not small

S
Sergey Gornostaev, 2018-01-12
@sergey-gornostaev

The economy will also be an important part of the implementation.
All five years of study at the Faculty of Economics, I imagined the economy as an apparatus with a thousand knobs, turning each of which changes the position of all the others by some little predictable angle, and the essence of the profession is to achieve the ideal position of all the knobs at the same time. After years of working in the field of trade automation and banking, I realized that my views were too optimistic. Good luck.

D
DollyPapper, 2018-01-13
@DollyPapper

The Lord advised him of everyone, think over the architecture, then think over, think over this. A man over there complains that, why the hell do I need this math of yours, can't it be simpler. we report and disperse, this is a necropost.
Well, if you still set the crowns on your game, then in the next update, bring the robberies of cows.

D
Danil Razumkov, 2018-01-13
@razumkov2015

Php is definitely bad here, but node.js. Download pm2, run js nickname and it works 24/7. You can already write all the logic there, cron is not needed here at all. Server take 1, but more expensive.

D
Dmitry Makarov, 2018-01-12
@MDiMaI666

I would implement such a world based on a gene algorithm to begin with.
Make a genome similar to a microbe, for example
https://m.habrahabr.ru/post/154387/
And then you will understand what needs to be done.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question