Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - foxhunter12

Pages: [1]
1
SFML projects / Re: Amsale
« on: March 26, 2016, 06:31:39 pm »
Alright! I think I may of fixed the jumpy movement. Amsale 1B is now up for download and that has the fix in it.

You fixed it! You should cap your framerate though, I move very fast now [because movement is based off of FPS, higher fps players will move faster than slower fps players]

2
SFML projects / Re: Amsale
« on: March 26, 2016, 01:42:52 am »
Alright! You can now go through 1x1 gaps easily and the game no longer crashes randomly. The crashes were caused by clicking off screen, the game attempted to place a block in the array that held the tile map, however because it was out of bounds it crashed. Also, you can't place blocks on the player. I'm still trying to figure out the issue with the jumpy movement because I can't replicate it. The new download is up.

Awesome! I actually was developing a simcity clone in SFML one time with a friend (barebones) just to see what we could do and I had the same exact problem with placement. As I asked before though, how do you update movement? FPS based or using a fixed timestep?

3
There is something wrong with your makefile then. You shouldn't need to delete outdated files yourself. You rely on .o files for linking, not on the targets that build these .o files so these targets can't replace outdated .o files to link the app. Maybe you should have src/ in names of the .o targets too?

I actually made my makefile a lot better and yes, i added src/ in the .o targets as well. It seems to work everytime without fail now since I have updated my game a little since fixing. Thanks for the help! If there's anything else bugging out I'll post on another forum post.

4
SFML projects / Re: Amsale
« on: March 26, 2016, 12:21:27 am »
Thanks :) I'm not able to replicate what you mean by the jumpy movement and I don't understand what you mean by the player collision box going through 1x1 squares. I'll make it so objects can't be placed where the player is standing. I like the idea of implementing the stats via a in game terminal, I think I'll show the basic stats (power, food, metal and that) on the screen always and then have a way to open up a terminal to show more in depth stats like how many generators there are. Perhaps you are thinking of a terminal like the ones in Fallout 4?



If I place 2 walls or generators 1 space apart (so there is an opening) and I try to walk through, I can't. As for the jumpy movement, I'm not entirely sure why it's only happening on my computer, how do you update movement? FPS or fixed timestep based?

5
SFML projects / Re: Amsale
« on: March 26, 2016, 12:09:26 am »
Alright, I've added a new link, I'm hoping this will fix any problems.

Works now! Movement is a bit jumpy, every 1 second or so he skips a beat and pushes a bodylength forward. I like it though.

A couple of other glitchy things (I know it's 2 days development, but just so you can fix  ;)) are that the player collision box can't walk through a 1x1 square.

Also when you place stuff inside of you, you get stuck, you should probably make it so that the player is moved out of it slowly or quickly, whatever.

Lastly, the game crashed randomly the first time running after around 15 seconds. All I did was place some generators and alt+tab to check something, when I clicked back and tried resizing the window and then alt-tabbed again, it crashed. I'm not sure why at all, but hey, could be a Windows 10 thing.

Overall great concept and awesome quick-work on it. I suck at collisions so it's crazy seeing you whip that up so quickly. Good luck!

Something else; I like the console for updating resources and generators, miners,  etc placed. Maybe you can make a pseudo-console ingame for displaying stats? Like press Q and a fake console pops up with stats of the game?

6
SFML projects / Re: Amsale
« on: March 26, 2016, 12:08:06 am »
Alright, I've added a new link, I'm hoping this will fix any problems.

Works now! Movement is a bit jumpy, every 1 second or so he skips a beat and pushes a bodylength forward. I like it though.

A couple of other glitchy things (I know it's 2 days development, but just so you can fix  ;)) are that the player collision box can't walk through a 1x1 square.

Also when you place stuff inside of you, you get stuck, you should probably make it so that the player is moved out of it slowly or quickly, whatever.

Lastly, the game crashed randomly the first time running after around 15 seconds. All I did was place some generators and alt+tab to check something, when I clicked back and tried resizing the window and then alt-tabbed again, it crashed. I'm not sure why at all, but hey, could be a Windows 10 thing.

Overall great concept and awesome quick-work on it. I suck at collisions so it's crazy seeing you whip that up so quickly. Good luck!

7
Fixed!! After I fixed the bug from Weapon.cpp, I just had to delete the .o files and compiling and running worked. Weird how it gave me the error with sf::Texture::LoadFromFile. Thanks for all the help @FRex

8
#include <SFML/Graphics.hpp>

int main()
{
    sf::Texture tex;
    tex.loadFromFile("some-image.png");
}

That's what it looks like in all files; here's it from Tree.cpp

if(!texture.loadFromFile("src/assets/images/entities/tree1.png")){
    cout << "Failed to load src/assets/images/entities/tree1.png" << endl;
}
if(!shadowTexture.loadFromFile("src/assets/images/entities/treetop1.png")){
    cout << "Failed to load src/assets/images/entities/treetop1.png" << endl;
}

9
There is same symbol in .so as in the .o . It's strange this happens. Does a single file that just loads a Texture link?
You also have an error in your code BTW, one of these cryptic linker ones where you miss a destructor or virtual keyword or something:
Quote
Weapon.cpp:(.text._ZN5EnemyD2Ev[_ZN5EnemyD5Ev]+0x13): undefined reference to `vtable for Enemy'

Thanks for the error, I fixed that. What do you mean by "Does a single file that just loads a Texture link?"

11
http://pastebin.com/yqnjNbBb

Those are the nm --demangle's, I didnt want to put them on the forum due to the massive length of the graphics.so.

12
@eXpl0it43r I used 3 packages of SFML: 1st was the Fedora 23 built in repo, then I tried the SFML 2.3.2 that I used [exact files] in Linux Mint which worked in Mint but not Fedora, then I tried to build it my self. None worked. And my compiler is gcc-c++, I just typed "sudo dnf install gcc-c++" just to get the newest version that Fedora provides. I did that in mint too (sudo apt-get install gcc-c++) so the compilers are the same.

13
Quote
[hunter@localhost ~]$ ldconfig -p | grep sfml
   libsfml-window.so.2.3 (libc6,x86-64) => /lib64/libsfml-window.so.2.3
   libsfml-window.so.2.3 (libc6) => /lib/libsfml-window.so.2.3
   libsfml-window.so (libc6,x86-64) => /lib64/libsfml-window.so
   libsfml-window.so (libc6) => /lib/libsfml-window.so
   libsfml-system.so.2.3 (libc6,x86-64) => /lib64/libsfml-system.so.2.3
   libsfml-system.so.2.3 (libc6) => /lib/libsfml-system.so.2.3
   libsfml-system.so (libc6,x86-64) => /lib64/libsfml-system.so
   libsfml-system.so (libc6) => /lib/libsfml-system.so
   libsfml-network.so.2.3 (libc6,x86-64) => /lib64/libsfml-network.so.2.3
   libsfml-network.so.2.3 (libc6) => /lib/libsfml-network.so.2.3
   libsfml-network.so (libc6,x86-64) => /lib64/libsfml-network.so
   libsfml-network.so (libc6) => /lib/libsfml-network.so
   libsfml-graphics.so.2.3 (libc6,x86-64) => /lib64/libsfml-graphics.so.2.3
   libsfml-graphics.so.2.3 (libc6) => /lib/libsfml-graphics.so.2.3
   libsfml-graphics.so (libc6,x86-64) => /lib64/libsfml-graphics.so
   libsfml-graphics.so (libc6) => /lib/libsfml-graphics.so
   libsfml-audio.so.2.3 (libc6,x86-64) => /lib64/libsfml-audio.so.2.3
   libsfml-audio.so.2.3 (libc6) => /lib/libsfml-audio.so.2.3
   libsfml-audio.so (libc6,x86-64) => /lib64/libsfml-audio.so
   libsfml-audio.so (libc6) => /lib/libsfml-audio.so

-- yes

14
Nope, I tried all 6 combinations (3 * 2 * 1) but nothing changed.

15
On Fedora 23 when I try to use the native SFML libraries for my game I get the error while compiling:

Quote
[hunter@localhost Winter Wasteland]$ make
** Building the game
g++ -o WinterWasteland src/main.o src/Knife.o src/Player.o src/Snowpile.o src/Tree.o src/Weapon.o src/Snowflake.o -std=c++11 -lsfml-graphics -lsfml-window -lsfml-system
src/main.o: In function `main':
main.cpp:(.text+0x945): undefined reference to `sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)'
src/Player.o: In function `Player::Player(sf::Vector2<float>, PlayerDirection, PlayerAimDirection, float, int, int)':
Player.cpp:(.text+0xea): undefined reference to `sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)'
src/Snowpile.o: In function `Snowpile::Snowpile(sf::Vector2<float>, int)':
Snowpile.cpp:(.text+0x91): undefined reference to `sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)'
src/Tree.o: In function `Tree::Tree(sf::Vector2<float>, int)':
Tree.cpp:(.text+0xfd): undefined reference to `sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)'
Tree.cpp:(.text+0x185): undefined reference to `sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)'
src/Weapon.o:Weapon.cpp:(.text+0x5d3): more undefined references to `sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)' follow
src/Weapon.o: In function `Enemy::~Enemy()':
Weapon.cpp:(.text._ZN5EnemyD2Ev[_ZN5EnemyD5Ev]+0x13): undefined reference to `vtable for Enemy'
src/Snowflake.o: In function `Snowflake::Snowflake(sf::Vector2<float>, int, int, sf::Vector2<float>)':
Snowflake.cpp:(.text+0xd5): undefined reference to `sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)'
collect2: error: ld returned 1 exit status
makefile:31: recipe for target 'winterwasteland' failed
make: *** [winterwasteland] Error 1

I am not using Codeblocks or Eclipse, just editing files and compiling through console. This worked on LInux Mint and Ubuntu but Fedora is having issues. Even if I link to a CMake build of SFML I did recently to try to fix this problem, I get the same exact error. Not sure why. Here is how I compile [Makefile]:

Quote
CXX := g++

CXXFLAGS:=-std=c++11

LIBS= -lsfml-graphics -lsfml-window -lsfml-system

all: winterwasteland

main.o: src/main.cpp
   $(CXX) -c $(CXXFLAGS) "src/main.cpp" -o src/main.o

Knife.o: src/Knife.cpp src/Knife.h
   $(CXX) -c $(CXXFLAGS) "src/Knife.cpp" -o src/Knife.o

Player.o: src/Player.cpp src/Player.h
   $(CXX) -c $(CXXFLAGS) "src/Player.cpp" -o src/Player.o

Snowpile.o: src/Snowpile.cpp src/Snowpile.h
   $(CXX) -c $(CXXFLAGS) "src/Snowpile.cpp" -o src/Snowpile.o

Tree.o: src/Tree.cpp src/Tree.h
   $(CXX) -c $(CXXFLAGS) "src/Tree.cpp" -o src/Tree.o

Weapon.o: src/Weapon.cpp src/Weapon.h
   $(CXX) -c $(CXXFLAGS) "src/Weapon.cpp" -o src/Weapon.o

winterwasteland: src/main.o src/Knife.o src/Player.o src/Snowpile.o src/Tree.o src/Weapon.o src/Snowflake.o
   @echo "** Building the game"
   $(CXX) -o WinterWasteland src/main.o src/Knife.o src/Player.o src/Snowpile.o src/Tree.o src/Weapon.o src/Snowflake.o $(CXXFLAGS) $(LIBS)

Thanks. Will provide more info if needed.

Pages: [1]