Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a51660f
feat: README
p1onerka Oct 28, 2025
1e640c4
feat: CONTRIBUTING.md
p1onerka Oct 29, 2025
f26f708
ref: link fixes
p1onerka Oct 29, 2025
c4a6637
feat: action for deploying docs
p1onerka Oct 29, 2025
c0c5e2f
ref: add readme into CI for testing purposes
p1onerka Oct 29, 2025
29ed94d
ref: change testing event to PR
p1onerka Oct 29, 2025
43dc008
ref: CI testing
p1onerka Oct 29, 2025
197f7f2
ref: give the docs action permission to write
p1onerka Oct 29, 2025
40c2a2a
feat: add link to docs in README and CONTRIBUTING
p1onerka Oct 29, 2025
608f67f
ref: delete testing from docs action
p1onerka Oct 29, 2025
c50975d
Merge pull request #11 from p1onerka/new-complete
sofyak0zyreva Oct 30, 2025
c9aa5c3
feat: new assets
p1onerka Oct 31, 2025
de06ac9
ref: use new assets in demo
p1onerka Oct 31, 2025
6bd1f00
feat: diagonal moves
p1onerka Oct 31, 2025
393b444
ref: clippy (remove -> ())
p1onerka Oct 31, 2025
9e1f836
ref: put asset sources into list
p1onerka Oct 31, 2025
4cb0f4f
feat: assets of tiles
p1onerka Oct 31, 2025
e57d21e
ref: shadows are now producing from main image
p1onerka Oct 31, 2025
802dc34
ref: change shadow into bool property
p1onerka Oct 31, 2025
aedaa0a
ref: add has_shadow into renderable
p1onerka Oct 31, 2025
8c3ad77
feat: interfaces for objects creating
p1onerka Oct 31, 2025
fca3336
ref: test data
p1onerka Oct 31, 2025
55fb94f
ref: arch for tiles
p1onerka Oct 31, 2025
37c8df0
feat: interface module in lib.rs
p1onerka Oct 31, 2025
db9a60c
Add README into beautify
p1onerka Oct 31, 2025
8c90930
ref: fmt
p1onerka Oct 31, 2025
732b01b
ref: clippy
p1onerka Oct 31, 2025
6fadbf3
ref: README
p1onerka Oct 31, 2025
e6e2cc8
feat: performance diagram
p1onerka Nov 1, 2025
b9462d2
feat: diag into readme
p1onerka Nov 1, 2025
65f23c6
ref: update assets for demo
p1onerka Nov 1, 2025
d4a6445
feat: demo in README
p1onerka Nov 1, 2025
cfa9875
ref: fmt
p1onerka Nov 1, 2025
5220c59
ref: demo in gif
p1onerka Nov 1, 2025
ade817b
ref: clean code
p1onerka Nov 1, 2025
de55b6d
ref: clean screen
p1onerka Nov 1, 2025
0171bc8
ref: clean code in render
p1onerka Nov 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy Documentation

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

permissions:
contents: write

jobs:
Build-And-Deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rust-docs

- name: Generate Documentation
run: |
cargo doc --no-deps --all-features
echo "<meta http-equiv=\"refresh\" content=\"0; url=rusty_ache/index.html\">" > target/doc/index.html

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
publish_branch: docs
force_orphan: true
88 changes: 88 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Contributing to rusty_ache

All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions.

## Table of Contents

- [I Have a Question](#i-have-a-question)
- [I Want To Contribute](#i-want-to-contribute)
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Enhancements](#suggesting-enhancements)


## I Have a Question

> If you want to ask a question, we assume that you have read the available [documentation](https://p1onerka.github.io/rusty_ache/rusty_ache/index.html).

Before you ask a question, it is best to search for existing [Issues](https://github.com/p1onerka/rusty_ache/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue.

If you then still feel the need to ask a question and need clarification, we recommend the following:

- Open an [Issue](https://github.com/p1onerka/rusty_ache/issues/new).
- Provide as much context as you can about what you're running into.
- Provide project and platform versions, depending on what seems relevant.

We will then take care of the issue as soon as possible.

## I Want To Contribute

> ### Legal Notice
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project licence.

### Reporting Bugs

#### Before Submitting a Bug Report

A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.

- Make sure that you are using the latest version.
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://p1onerka.github.io/rusty_ache/rusty_ache/index.html). If you are looking for support, you might want to check [this section](#i-have-a-question)).
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the bug tracker.
- Collect information about the bug:
- Stack trace (Traceback)
- OS, Platform and Version (Windows, Linux, macOS, x86, ARM).
- Version of the compiler, SDK, runtime environment, depending on what seems relevant.
- Possibly your input and the output.
- Can you reliably reproduce the issue? And can you also reproduce it with older versions?

#### How Do I Submit a Good Bug Report?

> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to xeniia.ka@gmail.com.

We use GitHub issues to track bugs and errors. If you run into an issue with the project:

- Open an [Issue](https://github.com/p1onerka/rusty_ache/issues/new).
- Explain the behavior you would expect and the actual behavior.
- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. For good bug reports you should isolate the problem and create a reduced test case.
- Provide the information you collected in the previous section.

Once it's filed:

- The project team will label the issue accordingly.
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps.
- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be implemented by someone.


### Suggesting Enhancements

This section guides you through submitting an enhancement suggestion for *rusty_ache* including completely new features and minor improvements to existing functionality. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.

#### Before Submitting an Enhancement

- Make sure that you are using the latest version.
- Read the [documentation](https://p1onerka.github.io/rusty_ache/rusty_ache/index.html) carefully and find out if the functionality is already covered, maybe by an individual configuration.
- Perform a [search](https://github.com/p1onerka/rusty_ache/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.

#### How Do I Submit a Good Enhancement Suggestion?

Enhancement suggestions are tracked as [GitHub issues](https://github.com/p1onerka/rusty_ache/issues).

- Use a clear and descriptive title for the issue to identify the suggestion.
- Provide a step-by-step description of the suggested enhancement in as many details as possible.
- Describe the current behavior and explain which behavior you expected to see instead and why. At this point you can also tell which alternatives do not work for you.
- You may want to include screenshots or screen recordings which help you demonstrate the steps or point out the part which the suggestion is related to.
- Explain why this enhancement would be useful to most *rusty_ache* users. You may also want to point out the other projects that solved it better and which could serve as inspiration.

## Attribution
This guide is based on the [contributing.md](https://contributing.md/generator)!
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
name = "rusty_ache"
version = "0.1.0"
edition = "2024"
documentation = "https://p1onerka.github.io/rusty_ache"
repository = "https://github.com/p1onerka/rusty_ache"

[[bin]]
name = "main"
Expand All @@ -12,3 +14,6 @@ path = "src/bin/main.rs"
image = "0.25.8"
pixels = "0.15.0"
winit = "0.30.12"

[package.metadata.docs.rs]
all-features = true
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,41 @@
# rusty_ache
# Rusty Ache
Blazingly fast game engine written in Rust.

## How to run
Clone this repo:
```bash
git clone git@github.com:p1onerka/rusty_ache.git
```
Open the project:
```bash
cd rusty_ache
```
Run the project:
```bash
cargo run --bin main
```

## Demo

![Demo](resources/demo_gif.gif)

## Docs
Project documentation is availible [here](https://p1onerka.github.io/rusty_ache/rusty_ache/index.html).

## Performance

Below is a graph showing the dependence of FPS on the number of simultaneously rendered objects, created under the following conditions:

- Setup: MacBook M1, 8Gb RAM
- Data: 113x113px object
- Resolution: 200x200px

![Performance diagram](resources/perf_diag.png)

As shown on the graph, the engine’s performance is above 20 FPS with <=40 objects. It is strongly discouraged to add more than this number of objects with a size similar to 113x113px on a range smaller than resolution parameters.

## Devs
- [Aleksei Dmitrievstev](https://github.com/admitrievtsev)
- [Ksenia Kotelnikova](https://github.com/p1onerka)
- [Sofya Kozyreva](https://github.com/sofyak0zyreva)
- [Kostya Oreshin](https://github.com/sevenbunu)
Binary file added resources/demo_gif.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/demo_gif_small.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/perf_diag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 25 additions & 105 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -1,114 +1,34 @@
use image::ImageReader;

use rusty_ache::Resolution;
use rusty_ache::engine::config::{Config, EngineConfig};
use rusty_ache::engine::scene::Scene;
use rusty_ache::engine::Engine;
use rusty_ache::engine::scene::game_object::GameObject;
use rusty_ache::engine::scene::game_object::components::script::Script;
use rusty_ache::engine::scene::game_object::components::sprite::Sprite;
use rusty_ache::engine::scene::game_object::position::Position;
use rusty_ache::engine::scene::game_object::{GameObject, Object};
use rusty_ache::engine::{Engine, GameEngine};
use rusty_ache::interface::{create_obj_with_img, init_engine, init_scene};
use rusty_ache::screen::{HEIGHT, WIDTH};

fn main() {
let mut engine = GameEngine::new(
Box::new(EngineConfig::new(Resolution::new(WIDTH, HEIGHT))),
Scene::new(
vec![
GameObject::new(
vec![Box::new(Sprite::new(
Some(
ImageReader::open("src/bin/resources/command_center.png")
.unwrap()
.decode()
.unwrap(),
),
None,
(0, 0),
))],
None,
Position {
x: 0,
y: 0,
z: 1,
is_relative: false,
},
),
GameObject::new(
vec![Box::new(Sprite::new(
Some(
ImageReader::open("src/bin/resources/command_center.png")
.unwrap()
.decode()
.unwrap(),
),
Some((
ImageReader::open("src/bin/resources/cc_shadow.png")
.unwrap()
.decode()
.unwrap(),
(-7, 4),
)),
(0, 0),
))],
None,
Position {
x: 130,
y: -100,
z: 2,
is_relative: false,
},
),
GameObject::new(
vec![Box::new(Sprite::new(
Some(
ImageReader::open("src/bin/resources/command_center.png")
.unwrap()
.decode()
.unwrap(),
),
Some((
ImageReader::open("src/bin/resources/cc_shadow.png")
.unwrap()
.decode()
.unwrap(),
(-7, 4),
)),
(0, 0),
))],
None,
Position {
x: 15,
y: -25,
z: 3,
is_relative: false,
},
),
],
vec![Box::new(Sprite::new(
Some(
ImageReader::open("src/bin/resources/battlecruiser_main.png")
.unwrap()
.decode()
.unwrap(),
),
Some((
ImageReader::open("src/bin/resources/bc_shadow.png")
.unwrap()
.decode()
.unwrap(),
(0, -10),
)),
(60, -60),
))],
Position {
x: -10,
y: 10,
z: 0,
is_relative: false,
},
),
let tower_obj = create_obj_with_img("src/bin/resources/tower.png", 82, 37, true);
let junk_house_obj = create_obj_with_img("src/bin/resources/junk_house.png", 150, -150, true);
let pool_house_obj = create_obj_with_img("src/bin/resources/pool_house.png", 15, -25, true);
let tall_house_obj = create_obj_with_img("src/bin/resources/tall_house.png", 210, -80, true);
let skyscraper_obj = create_obj_with_img("src/bin/resources/skyscraper.png", 150, 55, true);
let cabin_obj = create_obj_with_img("src/bin/resources/cabin.png", 280, -60, true);
let main_ship_obj = create_obj_with_img("src/bin/resources/white_ship.png", 0, 0, true);

let hermit_house_obj = create_obj_with_img("src/bin/resources/junk_house.png", 400, 240, true);

let scene = init_scene(
&[
cabin_obj,
skyscraper_obj,
hermit_house_obj,
tower_obj,
tall_house_obj,
junk_house_obj,
pool_house_obj,
],
main_ship_obj,
);
let mut engine = init_engine(scene, WIDTH, HEIGHT);
engine.render().unwrap();
engine.run().unwrap()
}
Expand Down
Binary file removed src/bin/resources/battlecruiser_main.png
Binary file not shown.
Binary file removed src/bin/resources/bc_shadow.png
Binary file not shown.
Binary file added src/bin/resources/block_building.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/bin/resources/cabin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/bin/resources/cc_shadow.png
Binary file not shown.
Binary file removed src/bin/resources/command_center.png
Binary file not shown.
Binary file added src/bin/resources/junk_house.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/bin/resources/pool_house.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/bin/resources/power_line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/bin/resources/skyscraper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/bin/resources/sources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Asset sources
All of the assets from demo are availible for free usage, you can check them out here:

- [ship](https://starlight-furnace.itch.io/starlight-menagerie)
- [buildings](https://morithedaichi.itch.io/future-assets-free)
- [tiles](https://starlight-furnace.itch.io/isometric-map-pack-archology-south)
Binary file added src/bin/resources/tall_house.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/bin/resources/tile1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/bin/resources/tile2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/bin/resources/tile3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/bin/resources/tower.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/bin/resources/white_ship.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 16 additions & 4 deletions src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ use crate::engine::scene_manager::SceneManager;
use crate::render::renderer::DEFAULT_BACKGROUND_COLOR;
use crate::render::renderer::Renderer;
use crate::screen::{App, HEIGHT, WIDTH};
//use image::ImageReader;
use std::io::Error;
use std::sync::atomic::Ordering;
use std::sync::{Arc, RwLock};
use std::thread;
use std::time::Duration;
use winit::event_loop::{ControlFlow, EventLoop};
use winit::keyboard::KeyCode;
use winit::window::Window;

/// A trait for describing entity for main engine logic
Expand Down Expand Up @@ -57,6 +58,10 @@ impl Engine for GameEngine {
//config,
render: Arc::new(RwLock::from(Renderer::new(
res,
/*Some(ImageReader::open("src/bin/resources/tile2.png")
.unwrap()
.decode()
.unwrap())*/
None,
SceneManager::new(scene),
))),
Expand All @@ -80,7 +85,8 @@ impl Engine for GameEngine {
let shared_window_clone = shared_window.clone();

let mut app = App::new(shared_pixel_data, shared_window);
let key_pressed_clone = app.key_pressed.clone();
//let key_pressed_clone = app.key_pressed.clone();
let keys_pressed_clone = app.keys_pressed.clone();
let renderer = self.render.clone();
// Producer thread
thread::spawn(move || {
Expand All @@ -95,13 +101,19 @@ impl Engine for GameEngine {

let screen_size = (WIDTH * HEIGHT) as usize;
loop {
let vector_move = match *key_pressed_clone.read().unwrap() {
/*let vector_move = match *key_pressed_clone.read().unwrap() {
Some(KeyCode::KeyW) => (0, 1),
Some(KeyCode::KeyA) => (-1, 0),
Some(KeyCode::KeyS) => (0, -1),
Some(KeyCode::KeyD) => (1, 0),
_ => (0, 0),
};
};*/
let dx = (keys_pressed_clone.d.load(Ordering::Relaxed) as i32)
- (keys_pressed_clone.a.load(Ordering::Relaxed) as i32);
let dy = (keys_pressed_clone.w.load(Ordering::Relaxed) as i32)
- (keys_pressed_clone.s.load(Ordering::Relaxed) as i32);

let vector_move = (dx, dy);
//println!("{:?}", vector_move);
renderer
.write()
Expand Down
Loading